excel
I have a question about an Excel function.  One column contains the date of birth of participants, is there any possibility that the next column the age of the consumer contains?
March 5th, 2015 4:54am

Assuming the date of birth field is in cell "D1" you would place =DATEDIF (D1, TODAY, "y")

The following is a general ideal on the DATEDIF function in excel.

-----------

https://support.office.com/en-in/article/DATEDIF-function-39c703d5-c514-4092-83c3-73a8bae5d165

DATEDIF function

Syntax

DATEDIF (start_date,end_date,unit)

IMPORTANT   Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use =DATE(2008,5,23) for the 23rd day of May, 2008. Problems might occur if dates are entered as text.

Argument

Description

Remarks

start_date

A date that represents the first, or starting, date of the period.

  • None.

end_date

A date that represents the last, or ending, date of the period.

  • The end_date argument must be a date that occurs afterstart_date. The day of the ending date is not counted in the final result.

unit

The type of information you want returned.

  • None.

Units

Unit

Returns

"Y"

The number of complete calendar years in the period.

"M"

The number of complete named months in the period.

"D"

The number of complete named days in the period.

"MD"

The number of days from start_date to end_date. The months and years of the dates are ignored.

"YM"

The number of months from the month of start_date to the month of end_date. The days and years of the dates are ignored.

"YD"

The number of days from start_date to end_date. The years of the dates are ignored.

Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

To make the following example easier to understand, you can copy the data to a blank sheet and then enter the function underneath the data. Do not select the row or column headings (1, 2, 3... A, B, C...) when you copy the sample data to a blank sheet.

Date

=DATE (2001,6,1)

=DATE (2002,8,15)

Formula

Description (Result)

=DATEDIF(DATE(2001,1,1),DATE(2003,1,1),"Y")

Equals 2, or two complete years in the period (2)

=DATEDIF (A2,A3,"D")

Equals 440, or 440 days from June 1, 2001, to August 15, 2002 (440)

=DATEDIF (A2,A3,"YD")

Equals 75, or 75 days from June 1 to August 15, ignoring the years of the dates (75)

=DATEDIF (A2,A3,"MD")

Equals 14, or the difference between 1 and 15  the day of start_dateand the day of end_date  ignoring the months and the years of the dates (14)

=DATEDIF (A3,A2,"D")

Displays a #NUM! error because start_date occurs before end_date(#NUM!)



  • Edited by Micric82 21 hours 8 minutes ago
Free Windows Admin Tool Kit Click here and download it now
March 5th, 2015 6:09am

Assuming the date of birth field is in cell "D1" you would place =DATEDIF (D1, TODAY, "y")

The following is a general ideal on the DATEDIF function in excel.

-----------

https://support.office.com/en-in/article/DATEDIF-function-39c703d5-c514-4092-83c3-73a8bae5d165

DATEDIF function

Syntax

DATEDIF (start_date,end_date,unit)

IMPORTANT   Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use =DATE(2008,5,23) for the 23rd day of May, 2008. Problems might occur if dates are entered as text.

Argument

Description

Remarks

start_date

A date that represents the first, or starting, date of the period.

  • None.

end_date

A date that represents the last, or ending, date of the period.

  • The end_date argument must be a date that occurs afterstart_date. The day of the ending date is not counted in the final result.

unit

The type of information you want returned.

  • None.

Units

Unit

Returns

"Y"

The number of complete calendar years in the period.

"M"

The number of complete named months in the period.

"D"

The number of complete named days in the period.

"MD"

The number of days from start_date to end_date. The months and years of the dates are ignored.

"YM"

The number of months from the month of start_date to the month of end_date. The days and years of the dates are ignored.

"YD"

The number of days from start_date to end_date. The years of the dates are ignored.

Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

To make the following example easier to understand, you can copy the data to a blank sheet and then enter the function underneath the data. Do not select the row or column headings (1, 2, 3... A, B, C...) when you copy the sample data to a blank sheet.

Date

=DATE (2001,6,1)

=DATE (2002,8,15)

Formula

Description (Result)

=DATEDIF(DATE(2001,1,1),DATE(2003,1,1),"Y")

Equals 2, or two complete years in the period (2)

=DATEDIF (A2,A3,"D")

Equals 440, or 440 days from June 1, 2001, to August 15, 2002 (440)

=DATEDIF (A2,A3,"YD")

Equals 75, or 75 days from June 1 to August 15, ignoring the years of the dates (75)

=DATEDIF (A2,A3,"MD")

Equals 14, or the difference between 1 and 15  the day of start_dateand the day of end_date  ignoring the months and the years of the dates (14)

=DATEDIF (A3,A2,"D")

Displays a #NUM! error because start_date occurs before end_date(#NUM!)



  • Edited by Micric82 4 hours 24 minutes ago
March 5th, 2015 6:09am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics