adjust formula to much info

W

Wanna Learn

Hello how do I adjust the formula below so that when the answer is is less
than 1 year it only shows the number of months . example 10 months to read
read 10M not 0Y 10M and if over 1 year to show 1Y 10M
=DATEDIF(A1,A2,"y")&" Y "&DATEDIF(A1,A2,"ym")&" M"

As always, thanks
 
D

David Biddulph

=IF(DATEDIF(A1,A2,"y")=0,"",DATEDIF(A1,A2,"y")&" Y ")&DATEDIF(A1,A2,"ym")&"
M"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top