Calculate duration while counting overlalling years once only

See the FAQ: How to do a minimal reproducible example reprex for beginners. This is probably doable, but make it easier by posting some usable data?