Wednesday, June 2, 2010

Throbbing In The Left Shoulder

Calculating Age in Years


"From a list of dates of birth of the personal need to calculate your age in years. Making use of the YEAR function do not get the required result because it does not take into account dates exact " .

Indeed, if we need to calculate the age in years of an individual, the role YEAR will not provide, as the difference between date of birth and date current, the desired result because it does not consider or months or days. For example, if we take as base today, June 2, 2010, and want to know how old he is someone who was born on November 28, 1969, formula = YEAR (A1)-YEAR (A2) A1-assuming that we have the current date and date of birth A2 "will return a score of 41, which is the difference between 2010 y1969. That is, the operation that the formula shown is 2010-1969 = 41. But obviously this is not the age of the individual in question, since June 2 will not yet reached the 41.

To calculate use the function correctly YEARFRAC . Suppose the following list:


We are located in cell D4 and type the formula:

= YEARFRAC (C4, TODAY (), 1)

YEARFRAC function calculates the fraction of year represents the number of whole days between a start date and end date. Its syntax is YEARFRAC ( start_date, end_date Base). In our example we use the starting date the employee's birth date and end date generated by the function TODAY (), ie the current day. After you copy the formula in the range D5 D4: D13, the result is the following:


To avoid decimal numbers we use the TRUNC . In cell E4 wrote:

= TRUNC (D4) and copy up to E13:


Obviously we can solve the whole problem with a single formula. In F4 wrote:

= TRUNC (YEARFRAC (C4, TODAY (), 1))


0 comments:

Post a Comment