Formula help

markster

Well-known Member
Joined
May 23, 2002
Messages
579
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Afternoon everyone

I need to do an IF formula that says that if the date in C2 is not BETWEEN 1-AUG-17 and 31-JUL-18 (inclusive than leave C2 Blank). Can anyone help. Thanks
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Use an OR statement with your IF, i.e.
Code:
=IF(OR(C2 < DATE<date(2017,8,1),c2>(2017,8,1),C2 > DATE(2018,7,31)),...)
</date(2017,8,1),c2>
 
Last edited:
Upvote 0
Use an OR statement with your IF, i.e.
Code:
=IF(OR(C2 < DATE<date(2017,8,1),c2>(2017,8,1),C2 > DATE(2018,7,31)),...)
</date(2017,8,1),c2>

Ok that's perfect thanks - much appreciated.

Mark
 
Upvote 0
Hi,

Another way to write it...

=IF(AND(C2>=DATE(2017,8,1),C2<=DATE(2018,7,31)),"value if true","")

Change "value if true" to what you want when C2 IS between 8/1/2017 and 7/31/2018, otherwise, results Blank.
 
Last edited:
Upvote 0
Hi,

Another way to write it...

=IF(AND(C2>=DATE(2017,8,1),C2<=DATE(2018,7,31)),"value if true","")

Change "value if true" to what you want when C2 IS between 8/1/2017 and 7/31/2018, otherwise, results Blank.

Thanks both -much appreciated.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

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