# Calculating dates

#### giggles1981

##### New Member
Hi

I already have a formula to calculate how old something is from the date it was purchased to todays date, however i need to be able to find out how many of these are older than 4 years.

Could anyone help me here?

thanks

### Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Welcome to the board!

=DATEDIF(A1,TODAY(),"Y")>=4

Should tell you if it is over 4 years old.

thanks for that equation but i couldnt get it to work

is there a way i can attach the spreadsheet to show you?

Hi
If the two dates are in A1 and B1 then the formula =YEAR(A1)-YEAR(B1) should give the answer you need
Bob

sorry still not working i have 3 columns 1 with the ship date of the product (I2 all the way to I796) then a column with todays date in J2 to J796) then a column with the following equation in to determin the age of the machines =K2MONTH(J766)-MONTH(I766)&" months"&" "&DAY(J766)-DAY(I766)&" days" but i need a formula in the next colum or wherever to find out exactly how many of these are more than 4 years old so we know how many to replace - usually i would be able to figure something but its friday and my brain has turned to mush!!!

Hi
From your second post the formula in column K calculates the age in months and days so if you take the first half of itL766 =MONTH(J766)-MONTH(I766) that will give you the number of months You now have to see if this is greater than 48 (4x12) .So what about this in column M
=IF(L766>48,"OVER","UNDER")

Or building on the formula i suggested before:

=SUMPRODUCT(--(DATEDIF(A1:A10,TODAY(),"Y")>=4))

Should give you the count of products older than 4 years.

Replies
7
Views
329
Replies
3
Views
433
Replies
4
Views
194
Replies
1
Views
597
Replies
13
Views
1K

1,203,464
Messages
6,055,577
Members
444,799
Latest member
CraigCrowhurst

### 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.

### Which adblocker are you using?

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

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