Using sumproduct for lookup

Fishboy

Well-known Member
Joined
Feb 13, 2015
Messages
4,267
Hi All,

I have been toying with some Excel 2010 data and I am trying to perform a lookup if the lookup value is between 2 other values. I have given an example of the lookup table below:

Excel 2010
ABC
1MinMaxOutput
2114N/A
31529TEST1
43052TEST2
55395TEST3
696100TEST4

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Chart



Now, the code I have tried to doctor from the interwebs (where the cell reference to look up is I6) is as follows:

=SUMPRODUCT((I6>=Chart!A2:A6)*(I6<=Chart!B2:B6)*Chart!C2:C6)

It was my understanding that the above would check if I6 is greater than A2:A6 and less than B2:B6 to give the value in the corresponding cell from C2:C6, however all I am getting is #VALUE!

Can anyone spot what I am doing wrong, or suggest an alternative way to lookup between 2 values?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
You are getting the #VALUE error because you are trying to multiply text values, try:


Excel 2012
ABCDEFGHIJ
1MinMaxOutput
2114N/A
31529TEST1
43052TEST2
55395TEST3
696100TEST416TEST1
Sheet1
Cell Formulas
RangeFormula
J6=LOOKUP(I6,A2:A6,C2:C6)
 
Upvote 0
Fantastic! Thanks for the speedy and, more importantly, correct advice!
 
Upvote 0
If your table is always a sorted table as shown then:

=IF(I6>$B$6,#N/A,LOOKUP(I6,$A$2:$A$6,$C$2:$C$6))
 
Upvote 0

Forum statistics

Threads
1,216,109
Messages
6,128,884
Members
449,477
Latest member
panjongshing

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