ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   adjust formula to much info (https://www.excelbanter.com/excel-discussion-misc-queries/200396-adjust-formula-much-info.html)

Wanna Learn

adjust formula to much info
 
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


David Biddulph[_2_]

adjust formula to much info
 
=IF(DATEDIF(A1,A2,"y")=0,"",DATEDIF(A1,A2,"y")&" Y ")&DATEDIF(A1,A2,"ym")&"
M"
--
David Biddulph

"Wanna Learn" wrote in message
...
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





All times are GMT +1. The time now is 11:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com