how old am i?

GaryR

Active Member
Joined
Mar 13, 2007
Messages
321
ok,
i was just bored and though i'd have excel show me exactly how old i am. so i typed this formula:

Code:
=NOW()-A1

in A1 is my birthday formatted as "m/d/yyyy h:mm" (9/30/1984 1:28)

so that tells me "3/18/1923 10:58" which i interpret as 23 years, 3 months, 18 days, 10 hours, 58 minutes. right?

except i'm 23 years, 2 months, 17 days, 10 hrs, 58 minutes. is it added 1 to month and day because it starts counting dates from 1/1/1900? (so year is 00 to start and month/day are 1?)

how do i circumvent this?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
With your date of birth in A1 try

="Age is "&DATEDIF(A1,TODAY(),"y")&" Years, "&DATEDIF(A1,TODAY(),"ym")&" Months and "&DATEDIF(A1,TODAY(),"md")&" Days"
 
Upvote 0
ok, now that's cool. wth is DATEDIF()?

i assume that stands for Date Difference, but i can't find any reference to it in Excel help for formula wizard...it's arguments seem different then regular m/d/y for output value.

where can i learn more?
 
Upvote 0
From Excel version 2000 Help:
DATEDIF

Calculates the number of days, months, or years between two dates. This function is provided for compatibility with Lotus 1-2-3.

Syntax

DATEDIF(start_date,end_date,unit)

Start_date is a date that represents the first, or starting, date of the period. Dates may be entered as text strings within quotation marks (for example, "2001/1/30"), as serial numbers (for example, 36921, which represents January 30, 2001, if you're using the 1900 date system), or as the results of other formulas or functions (for example, DATEVALUE("2001/1/30")). For more information about date serial numbers, see NOW.

End_date is a date that represents the last, or ending, date of the period.

Unit is the type of information you want returned.

Unit Returns
"Y" The number of complete years in the period.
"M" The number of complete months in the period.
"D" The number of days in the period.
"MD" The difference between the days in start_date and end_date. The months and years of the dates are ignored.
"YM" The difference between the months in start_date and end_date. The days and years of the dates are ignored.
"YD" The difference between the days of start_date and end_date. The years of the dates are ignored.


Remarks

Microsoft Excel stores dates as sequential serial numbers so that it can perform calculations on them. Excel stores January 1, 1900, as serial number 1 if your workbook uses the 1900 date system. If your workbook uses the 1904 date system, Excel stores January 1, 1904, as serial number 0 (January 2, 1904, is serial number 1). For example, in the 1900 date system, Excel stores January 1, 1998, as serial number 35796 because it is 35,795 days after January 1, 1900. Learn more about how Microsoft Excel stores dates and times.


Excel for Windows and Excel for the Macintosh use different date systems as their default. For more information, see NOW.
Examples

DATEDIF("2001/1/1","2003/1/1","Y") equals 2, or two complete years in the period.

DATEDIF("2001/6/1","2002/8/15","D") equals 440, or 440 days between June 1, 2001, and August 15, 2002.

DATEDIF("2001/6/1","2002/8/15","YD") equals 75, or 75 days between June 1 and August 15, ignoring the years of the dates.

DATEDIF("2001/6/1","2002/8/15","MD") equals 14, or the difference between 1 and 15 — the day of start_date and the day of end_date — ignoring the months and the years of the dates.
 
Upvote 0

Forum statistics

Threads
1,215,457
Messages
6,124,941
Members
449,197
Latest member
k_bs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top