If Date Formula

AlexKimball81

New Member
Joined
Dec 17, 2018
Messages
3
Hi,
I am trying to find a formula that if the date in cell A4 is within a year of the date in cell f1, it will do one formula, if it is between 1 and 2 years it will do another. Any input will be greatly appreciated.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hey, try this formula:
=IF(ABS(F1-A4)<=365,"Formula1","Formula2")
Where Formula1 and Formula2 are replaced by your designated formulae.
 
Upvote 0
=IF(ABS(F1-A4)<=365,"Formula1","Formula2")
Just note that will do Formula2 for any date greater than one year. If they truly want Formula2 only if it is between 1 and 2 years, you will need to nest another level of IF in there.
if it is between 1 and 2 years it will do another.
Something like:
Code:
[COLOR=#333333]=IF(ABS(F1-A4)<=365,"Formula1",IF(ABS(F1-A4)<=730,"Formula2",""))[/COLOR]
 
Last edited:
Upvote 0
You're right Joe, I only omitted nesting the function as there was no criteria in the original posting about a 3rd scenario, but of course then like you say, nesting another layer would be required!
I appreciate the pointer though.
 
Upvote 0

Forum statistics

Threads
1,223,718
Messages
6,174,082
Members
452,542
Latest member
Bricklin

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