Lookup based on date range

ryansm05

Board Regular
Joined
Sep 14, 2016
Messages
148
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm trying to find a formula that will help with the below conundrum (sorry for not using the XL2BB, but I don't have permission to download on my work laptop).

Basically, The criteria can be found in cell B7, B8 and B9 and the correct result of 3 has been returned in cell B10. What this is doing is:

1) Looking for a match along row 1 which is between the dates of 10/09/2022 and 18/09/2022
2) Looing for a match between B2:B4 for Team 3
3) Returning any cell that has text between cells C2:K4 (for what it's worth the cell with always be in the format XYZ(A) or ABC(H))


ABCDEFGHIJK
1
10/09/2022​
11/09/2022​
12/09/2022​
16/09/2022​
17/09/2022​
18/09/2022​
01/10/2022​
02/10/2022​
03/10/2022​
2Team 1WHU(H)SOU(A)MUN(H)
3Team 2NOT(A)NEW(H)WHU(A)
4Team 3NOT(H)MUN(A)AVL(H)CRY(A)
5
6
7TeamTeam 3
8Start Date10/09/2022
9End Date18/10/2022
10Result3

If anyone can help it'd be much appreciated.

Thanks
Ryan
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
For avoidance of doubt, the data in cell B9 should be 18/09/2022 - which is why only 3 values are returned.

Thanks
Ryan
 
Upvote 0
How does that equate to a result of 3? Or are you just trying to count how many cells have text?
The answer will be 3 because it's based on the criteria of Team 3 & data ranges as per the above. I basically see this as a fancy index/match, but I was unsure of how to build in a match criteria between dates.
 
Upvote 0
But why is it 3? Is it because there are 3 cells with a value?
 
Upvote 0
But why is it 3? Is it because there are 3 cells with a value?
Yes exactly. Three cells are populated with text. It's basically fixtures that a football team will play in a certain date period. For example, if the date criteria was extended to 03/10/2022 the answer would be 4 because of the CRY(A) fixture.

Thanks
Ryan
 
Upvote 0
Ok, how about
Excel Formula:
=SUMPRODUCT((B2:B4=B7)*(C1:K1>=B8)*(C1:K1<=B9)*(C2:K4<>""))
 
Upvote 0
Solution
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,198
Members
452,616
Latest member
intern444

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