ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   DATEDIF function (https://www.excelbanter.com/excel-discussion-misc-queries/132122-datedif-function.html)

mathew

DATEDIF function
 
Can the result of a DATEDIF function be displayed as years and months?

Example

Cell T47 displays 15-Jan-04. The formula in U47 is
=DATEDIF(T47,TODAY(),"y")&DATEDIF(T47,TODAY(),"ym" ). The result is 31 for 3
years and 1 month. Is there any way for the result to say 3 years 1 month?

Mike

DATEDIF function
 
Works with the date in A1 change as required if you don't want the days bit
simply delete the end piece of the formuula

=DATEDIF(A1,NOW(),"Y") & " Years, " & DATEDIF(A1,NOW(),"YM") & " Months, " &
DATEDIF(A1,NOW(),"MD") & " Days"

"mathew" wrote:

Can the result of a DATEDIF function be displayed as years and months?

Example

Cell T47 displays 15-Jan-04. The formula in U47 is
=DATEDIF(T47,TODAY(),"y")&DATEDIF(T47,TODAY(),"ym" ). The result is 31 for 3
years and 1 month. Is there any way for the result to say 3 years 1 month?


Vergel Adriano

DATEDIF function
 
=DATEDIF(T47,TODAY(),"y") & " year(s) " & DATEDIF(T47,TODAY(),"ym") & "
month(s)"

"mathew" wrote:

Can the result of a DATEDIF function be displayed as years and months?

Example

Cell T47 displays 15-Jan-04. The formula in U47 is
=DATEDIF(T47,TODAY(),"y")&DATEDIF(T47,TODAY(),"ym" ). The result is 31 for 3
years and 1 month. Is there any way for the result to say 3 years 1 month?


mathew

DATEDIF function
 
Mike,

With this formula, tomorrow should read 3 years 2 days, correct?

"Mike" wrote:

Works with the date in A1 change as required if you don't want the days bit
simply delete the end piece of the formuula

=DATEDIF(A1,NOW(),"Y") & " Years, " & DATEDIF(A1,NOW(),"YM") & " Months, " &
DATEDIF(A1,NOW(),"MD") & " Days"

"mathew" wrote:

Can the result of a DATEDIF function be displayed as years and months?

Example

Cell T47 displays 15-Jan-04. The formula in U47 is
=DATEDIF(T47,TODAY(),"y")&DATEDIF(T47,TODAY(),"ym" ). The result is 31 for 3
years and 1 month. Is there any way for the result to say 3 years 1 month?


David Biddulph

DATEDIF function
 
If you're starting off with 15/1/04, tomorrow will be 3 years 1 month 9 days
(or tomorrow will be 3 years 1 month 10 days in places like Australia, whee
it's already tomorrow today, if you see what I mean!).

I don't know where your 3 years 2 days comes from, Mathew?
--
David Biddulph

"mathew" wrote in message
...
Mike,

With this formula, tomorrow should read 3 years 2 days, correct?


"Mike" wrote:

Works with the date in A1 change as required if you don't want the days
bit
simply delete the end piece of the formuula

=DATEDIF(A1,NOW(),"Y") & " Years, " & DATEDIF(A1,NOW(),"YM") & " Months,
" &
DATEDIF(A1,NOW(),"MD") & " Days"


"mathew" wrote:

Can the result of a DATEDIF function be displayed as years and months?

Example

Cell T47 displays 15-Jan-04. The formula in U47 is
=DATEDIF(T47,TODAY(),"y")&DATEDIF(T47,TODAY(),"ym" ). The result is 31
for 3
years and 1 month. Is there any way for the result to say 3 years 1
month?




mathew

DATEDIF function
 
Mike & Vergel,

Thanks for the quick response. I can stop pulling my hair out now.

"Vergel Adriano" wrote:

=DATEDIF(T47,TODAY(),"y") & " year(s) " & DATEDIF(T47,TODAY(),"ym") & "
month(s)"

"mathew" wrote:

Can the result of a DATEDIF function be displayed as years and months?

Example

Cell T47 displays 15-Jan-04. The formula in U47 is
=DATEDIF(T47,TODAY(),"y")&DATEDIF(T47,TODAY(),"ym" ). The result is 31 for 3
years and 1 month. Is there any way for the result to say 3 years 1 month?



All times are GMT +1. The time now is 08:54 PM.

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