Lookup formula, multiple criteria, date range

bschulze

Active Member
Joined
Jun 2, 2005
Messages
289
I need a formula that will lookup a value based on two criteria, one just a cell reference, the other if the period falls within a given range. I was thinking this could be done using a Index>Match formula, but the date range is throwing me off. I'm hoping this can be accomplished without an array formula because the actual data set is lengthy. Any help in pointing me in the right direction would be greatly appreciated.



Excel 2012
ABCDEFGHI
1DataReference Table
2PeriodRef1Value LookupBegPeriodEndPeriodRef1Value
320150312002010012012061100
420150424002012072015061200
520130612002010012014122300
620140923002015012015062400
720130123002010012015063500
82011071100
92015061200
102013093500
112012071200
122012103500
132015032400
142014122300
Sheet1
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
It looks like your dates do not overlap for each "Ref1", and that the required result is always numeric.
If this is correct you can use sumproduct() or (if you have excel 2007+) use sumifs()
 
Upvote 0
The returned value will always be a number. I'm familiar with both sumproduct and sumif but not utilizing them with a date range, can you provide a quick example of both/either?
 
Upvote 0
See below. Note, I inserted extra columns into your sheet

Excel Workbook
ABCDEFGHIJK
1DataReference Table
2PeriodRef1Value LookupsumproductsumifsBegPeriodEndPeriodRef1Value
320150312002002002010012012061100
420150424004004002012072015061200
520130612002002002010012014122300
620140923003003002015012015062400
720130123003003002010012015063500
82011071100100100
92015061200200200
102013093500500500
112012071200200200
122012103500500500
132015032400400400
142014122300300300
Sheet2
 
Upvote 0
Thanks konew1, very slick. Not sure why I wasn't thinking about >= and <= but it makes perfect sense. Appreciate your knowledge.
 
Upvote 0
konew1, I found an instance where I need to lookup a text value, any suggestions on a formula for that? Same criteria above, just referencing a text value.
 
Upvote 0
Got it. I used the Sumproduct to return a row number and the Index to reference the column needed to pull the text value. Thanks again for your help.

=INDEX($L$3:$L$7,SUMPRODUCT(--($H$3:$H$7<=A3),--($I$3:$I$7>=A3),--($J$3:$J$7=B3),ROW($K$3:$K$7)-2),0)
 
Upvote 0
Clever. My very first response asked if all of the required results were numeric. If you told me some were text I would asked others to respond thinking sumproduct was irrelevant to you.
 
Upvote 0

Forum statistics

Threads
1,215,453
Messages
6,124,918
Members
449,195
Latest member
Stevenciu

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