multiple if using a date

uk747

Well-known Member
Joined
Jul 20, 2011
Messages
800
Office Version
  1. 365
Platform
  1. Windows
currently have:=IF(A1<=TODAY(),"Purchase Date","Error, Date cannot be greater than "&""&TEXT((TODAY()),"dd-mmm-yy"))What I want is if A1 is before 31/12/11 then "Out of Date"if between 31/12/11 to today then "Purchase Date" and finallyif after Today then "Error, Date canot be greater than "&""&TEXT((TODAY()),"dd-mmm-yy"))~Thanks
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
=IF(A1="","",IF(A1<DATE(2011,12,31),"Out of Date",IF(AND(A1>=DATE(2011,12,31),A1<=TODAY()),"Purchase date","Error, Date canot be greater than "&""&TEXT((TODAY()),"dd-mmm-yy"))))
 
Upvote 0
=IF(A1="","",IF(A1<DATE(2011,12,31),"Out of Date",IF(AND(A1>=DATE(2011,12,31),A1<=TODAY()),"Purchase date","Error, Date canot be greater than "&""&TEXT((TODAY()),"dd-mmm-yy"))))
says too many arguments for this function, also doesnt need the if a1="","" - If nothing is contained in A1 then it will still say "Purchase Date"
 
Upvote 0
=IF(OR(AND(A1 >= DATE(2011,12,31),A1 <= TODAY()),A1=""),"Purchase date",IF(A1 < DATE(2011,12,31),"Out of Date","Error, Date canot be greater than "&""&TEXT((TODAY()),"dd-mmm-yy")))

Remove spaces before ">" and after "<" sign.
 
Upvote 0
=IF(OR(AND(A1 >= DATE(2011,12,31),A1 <= TODAY()),A1=""),"Purchase date",IF(A1 < DATE(2011,12,31),"Out of Date","Error, Date canot be greater than "&""&TEXT((TODAY()),"dd-mmm-yy")))Remove spaces before ">" and after "<" sign.
Thanks Robert
 
Upvote 0

Forum statistics

Threads
1,203,561
Messages
6,056,082
Members
444,844
Latest member
Taps07

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