I have a data base with the date owners bought houses (6/1/88) and I am looking for a formula that will calculate how many years, months, days from that date to today. How do I do that?
I have a data base with the date owners bought houses (6/1/88) and I am looking for a formula that will calculate how many years, months, days from that date to today. How do I do that?
A B C 1 6/1/1988 2/13/201526 years 8 months 12 days
C1=IF(DATEDIF(A1,B1,"y")=0,"",DATEDIF(A1,B1,"y")&" years ")&IF(DATEDIF(A1,B1,"ym")=0,"",DATEDIF(A1,B1,"ym")&" months ")&DATEDIF(A1,B1,"md")&" days"
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Assumed your date in A1:
Put this on B1:
=TRIM(IF(INT((TODAY()-A1)/365,25)=0,"",INT((TODAY()-A1)/365,25)&" Years")&" "&IF(INT(MOD((TODAY()-A1)/365,25,1)*12)=0,"",INT(MOD((TODAY()-A1)/365,25,1)*12)&" Months")&" "&IF(INT(MOD((TODAY()-A1)/30,44,1)*30,44)=0,"",INT(MOD((TODAY()-A1)/30,44,1)*30,44)&" Days"))
Looking at azumi's post reminded me that I wanted to add...
if you dont want to put =TODAY() in its own cell, you could include it into my formula like this...
=IF(DATEDIF(A1,TODAY(),"y")=0,"",DATEDIF(A1,TODAY(),"y")&" years ")&IF(DATEDIF(A1,TODAY(),"ym")=0,"",DATEDIF(A1,TODAY(),"ym")&" months ")&DATEDIF(A1,TODAY(),"md")&" days"
(if you have a LOT of dates to check, it would be better to have it in it's own cell, then reference it)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks