Date Comparison error

DPChristman

Board Regular
Joined
Sep 4, 2012
Messages
171
Office Version
  1. 365
Platform
  1. Windows
I have a strange error that I am running into with trying to determine the age of an employee.

The formula I have in place is =SUM(NOW()-H5)/365, where H5 is the date of birth.

The formula works most of the time, but then I get these odd incorrect responses.

I have added multiple decimal points to try and get the age as accurate as possible, and still getting these errors.

Example using today's date (10/26/2020), and a birth date of 11/1/1990, the formula returns a value of 30.007.

This is clearly wrong. Does anyone know a fix or have a better formula for this?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Use Today & not Now.
Now returns the data & time, where the time value is a decimal fraction.
Also there is no need to use sum in that formula.
 
Upvote 0
Use Today & not Now.
Now returns the data & time, where the time value is a decimal fraction.
Also there is no need to use sum in that formula.
=(TODAY()-H2)/365 is still giving me the same result, though the decimal point has changed slightly
 
Upvote 0
Do you just want to take into account the year they were born?
If so use
Excel Formula:
=YEAR(TODAY())-YEAR(H5)
 
Upvote 0
Do you just want to take into account the year they were born?
If so use
Excel Formula:
=YEAR(TODAY())-YEAR(H5)
It has to be somewhat specific. I am running backgrounds, and the results are grouped by age (years old), so if I am dealing with a fairly common name. and the result should be 29, the formula returns 30, which can equal hundred of responses.
 
Upvote 0
I'm afraid I don't see where someone's name comes into calculating their age. :confused:
What exactly are you trying to get?
You don't seem to want a decimal portion, nor do you seem to want a whole number.
 
Upvote 0
I'm afraid I don't see where someone's name comes into calculating their age. :confused:
What exactly are you trying to get?
You don't seem to want a decimal portion, nor do you seem to want a whole number.
If I am looking for John Smith with a default age of 30, when in fact is should be 29.XXX, that will create a lot of false positives. If the year was accurate, that would be good. However, for example 2020-1990 is 30 years, but doing the search today, 2020 (now or today in the formula) - November 3rd, 1990 is 29 years However, the result I am getting is 30.000, which is wrong.
 
Upvote 0
I'm sorry but I still don't understand what you are trying to calculate.
Do you want a whole number of years or a fraction?
 
Upvote 0
I'm sorry but I still don't understand what you are trying to calculate.
Do you want a whole number of years or a fraction?
For the purpose of the search, the whole year is fine, but the issue is the formula is returning (example) 30, when the person is 29. Specifically when looking at days days that are close to today. If someone's DOB in 11/3/1990, they are not 30 years old, they are 29 years old.
 
Upvote 0

Forum statistics

Threads
1,213,491
Messages
6,113,963
Members
448,536
Latest member
CantExcel123

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