If AND Index Match? formulas

tutv088

New Member
Joined
Feb 18, 2014
Messages
24
Hi All I am trying to figure an easy way to determine if a date that the user enters falls within a specific date range. There are 2 criteria that must be met. The final result would be an indicator or simple Yes or No.

User Enters in information in Worksheet 1. 1. Program Name 2. County 3. Date.
ABCD
ProgramCountyDateProgram Y/N
BasketballWashington06/01/18
TennisKing08/06/16
TennisDavidson04/13/18

<tbody>
</tbody>









Database of Programs and dates of when they start and End ( Separate workbook with Info)
ABCD
ProgramCountyStartEnd
BasketballWashington05/01/1812/15/18
BaseballWashington04/12/1812/14/18
BaseballDavidson06/08/1706/15/18

<tbody>
</tbody>









I would like the row in the first workbook in Column D3 to say Yes. Thank you guys and appreciate all the help and support.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi Tut,

This post looks familiar...


ABCD
1ProgramCountyDateProgram Y/N
2BasketballWashington01-06-18Y
3TennisKing06-08-16N
4TennisDavidson13-04-18Y
5
6ProgramCountyStartEnd
7BasketballWashington01-05-1815-12-18
8BaseballWashington12-04-1814-12-18
9BaseballDavidson08-06-1715-06-18

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D2=IF(AND(C2>C7,C2<d7< font="">),"Y","N"</d7<>)
D3=IF(AND(C3>C8,C3<d8< font="">),"Y","N"</d8<>)
D4=IF(AND(C4>C9,C4<d9< font="">),"Y","N"</d9<>)

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0
Hi,

OP Also needs the "Program" and "County" included in the criterion as well as the dates, and the 2 Tables are in Different Workbooks...

Formula in Post #2 seems incomplete and does not address all requirements (might have gotten cut off).
 
Upvote 0
Hi Ras and thank you for helping me with this problem. I suppose I wasn't clear in my explanation and was hoping for a formula where when the user enters the Program, County and Date that it scans down the column of A:A, B:B doing a match then it will determine if the date the user entered is between the Start and End date. I know that gets complicated and thats why I am reaching out. The Program Country Start and End date is located in a different worksheet database. Hope that makes sense and thanks again buddy.
 
Upvote 0
Hi Ras, so for instance. I will describe what the formula should be doing. User Enters Program, County and Date. The formula in D2 should say something like take A2&B2 then scan in worksheet 2 column A:A&B:B and look over to the right to see if the date that the user entered is between the ranges of Start and End for that particular combo of Program and County.
 
Upvote 0
Yeah formula got cut off, sorry I rushed it a bit and misread the goal. I'll look again.
 
Upvote 0
In your OP, you indicated the two Tables are in Different Workbooks, but then in Post #4 and #5 , you indicated they're just in different Worksheets (that would mean same Workbook), so I'm assuming it's just different Worksheets within the same Workbook:

Try and see if this does what you need:


Book1
ABCD
1ProgramCountyDateProgram Y/N
2BasketballWashington6/1/2018Yes
3TennisKing8/6/2016No
4TennisDavidson4/13/2018No
Sheet142
Cell Formulas
RangeFormula
D2=IF(SUMPRODUCT((Sheet144!A$2:A$4=A2)*(Sheet144!B$2:B$4=B2)*(Sheet144!C$2:C$4<=C2)*(Sheet144!D$2:D$4>=C2)),"Yes","No")



Book1
ABCD
1ProgramCountyStartEnd
2BasketballWashington5/1/201812/15/2018
3BaseballWashington4/12/201812/14/2018
4BaseballDavidson6/8/20176/15/2018
Sheet144


Sheet142 D2 formula copied down.

Change Sheet144 (Database sheet name) to match yours, change/adjust Cell reference/range as needed.
 
Upvote 0
Snap

=IF(SUMPRODUCT((C2>=$C$7:$C$9)*(C2<=$D$7:$D$9)*($A$7:$A$9&$B$7:$B$9=A2&B2)),"Yes","No")
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,264
Members
449,075
Latest member
staticfluids

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