How to caluculate in excel like this format (3/26/2005-3/26/2010=1826)

i want like this format 3 months 5years) (3/5)

If you have 3/26/2005 in A1 and 6/26/2010 in A2, then to have it read this way - 3 months 5 years - use:

=DATEDIF(A1,A2,"M")-(DATEDIF(A1,A2,"Y")*12)&" months"&" "&DATEDIF(A1,A2,"Y")&" years"

To have it read as (3/5) use this:

="("&DATEDIF(A1,A2,"M")-(DATEDIF(A1,A2,"Y")*12)&"/"&DATEDIF(A1,A2,"Y")&")"

Note that in both of these cases the result is text - you can't add it or anything. You might want to consider having the months in one column and the years in another if you want to do that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.