If AND OR between two sets of Dates

sandwichgirl

New Member
Joined
Aug 13, 2007
Messages
31
Office Version
  1. 365
Platform
  1. Windows
Hi

I have a spreadie that has a different primary use, but I would like to use its data to create a separate pivot, but need to set up some filtering criteria first.
Within the columns of raw data I have a week ending date which I would like to use as part of an if/and/or formula in a new column. On another table I have the dates that I would like to use as the parameters for the formula.

I would like my formula to say something like:

If the date in table1columnX is between dateparameter1 or dateparameter2, then 26wks 2011 or if it is between dateparameter3 and dateparameter4, then 26wks 2010

I am using excel 2003 and got as far as:
=IF(AND(AA23956>=datetable!$I$5,AA23956<=datetable!$J$5)),"XX","") and this works but I can't get the second half of the question right.

Any advice or help is appreciated.

many thanks in anticipation

Lou
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Try like this

=IF(OR(AND(AA23956>=A,AA23956<=B),AND(AA23956>=C,AA23956<=D)),"XX","")
 
Upvote 0
Thank you for the rapid response, however I need the formula if to give one of two answers.

For example if it matches between dates A and B it should give one answer i.e. 26wks2010 or if it matches between C and D then 26wks2011.

cheers

Lou
 
Upvote 0
OK,

Try
=IF(AND(AA23956>=A,AA23956<=C),26wks2010,IF(AND(AA23956>=C,AA23956<=D),26wks2011))
 
Upvote 0

Forum statistics

Threads
1,224,532
Messages
6,179,388
Members
452,908
Latest member
MTDelphis

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