ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Year formula (https://www.excelbanter.com/excel-discussion-misc-queries/249632-year-formula.html)

Robert

Year formula
 
I have a row of birth dates on a sheet, and need a formula to determine how
many are over 60 years old.

The cell format for the dates is 11/30/2009


Jacob Skaria

Year formula
 
Try
=IF(DATEDIF(A1,TODAY(),"y")=60,"60 or above","")

OR year to year comparison
=IF(YEAR(TODAY())-YEAR(A1)=60,"60 or above","")

--
Jacob


"Robert" wrote:

I have a row of birth dates on a sheet, and need a formula to determine how
many are over 60 years old.

The cell format for the dates is 11/30/2009


T. Valko

Year formula
 
Assume your dates are in the range A1:J1

Enter this formula in A2 and copy across to J2:

=DATEDIF(A1,NOW(),"y")

Then to count how many are greater than 60:

=COUNTIF(A2:J2,"60")

--
Biff
Microsoft Excel MVP


"Robert" wrote in message
...
I have a row of birth dates on a sheet, and need a formula to determine how
many are over 60 years old.

The cell format for the dates is 11/30/2009




Robert

Year formula
 
=if(datedif(D2,today(),"y")=60,"60 or above","")

I tried the above formula and the cell states "60 or above" instead of
giving me a count of people over 60.

Thanks

"Jacob Skaria" wrote:

Try
=IF(DATEDIF(A1,TODAY(),"y")=60,"60 or above","")

OR year to year comparison
=IF(YEAR(TODAY())-YEAR(A1)=60,"60 or above","")

--
Jacob


"Robert" wrote:

I have a row of birth dates on a sheet, and need a formula to determine how
many are over 60 years old.

The cell format for the dates is 11/30/2009


Jacob Skaria

Year formula
 
To return the count of say row1 cell references A1:J1 try the below

=SUMPRODUCT((DATEDIF(A1:J1,TODAY(),"y")=60)*(A1:J 10))

--
Jacob


"Robert" wrote:

=if(datedif(D2,today(),"y")=60,"60 or above","")

I tried the above formula and the cell states "60 or above" instead of
giving me a count of people over 60.

Thanks

"Jacob Skaria" wrote:

Try
=IF(DATEDIF(A1,TODAY(),"y")=60,"60 or above","")

OR year to year comparison
=IF(YEAR(TODAY())-YEAR(A1)=60,"60 or above","")

--
Jacob


"Robert" wrote:

I have a row of birth dates on a sheet, and need a formula to determine how
many are over 60 years old.

The cell format for the dates is 11/30/2009



All times are GMT +1. The time now is 04:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com