Number value range comparison against single number

sanfrancisco

New Member
Joined
Dec 28, 2014
Messages
8
What is the best way to compare a large set of numbers against a single value. There are 10 cells which have a final value that changes dynamically with user input. Trying to compare this cell against the value range below. I tried a nested IF(AND..) but excel kicked back an error saying there are too many nested IF's so that option is out. Here are the values i'm comparing against the value range:

VALUES (To test against Value Range)
[TABLE="width: 59"]
<tbody>[TR]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]36[/TD]
[/TR]
[TR]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]95[/TD]
[/TR]
[TR]
[TD="align: right"]245[/TD]
[/TR]
[TR]
[TD="align: right"]352[/TD]
[/TR]
[TR]
[TD="align: right"]357[/TD]
[/TR]
[TR]
[TD="align: right"]379[/TD]
[/TR]
[TR]
[TD="align: right"]406[/TD]
[/TR]
</tbody>[/TABLE]

VALUE RANGE (between 0 and 1000 with following intervals to evaluate)
[TABLE="width: 76"]
<tbody>[TR]
[TD="align: right"]0[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]51[/TD]
[TD="align: right"]75[/TD]
[/TR]
[TR]
[TD="align: right"]76[/TD]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD="align: right"]101[/TD]
[TD="align: right"]150[/TD]
[/TR]
[TR]
[TD="align: right"]151[/TD]
[TD="align: right"]200[/TD]
[/TR]
[TR]
[TD="align: right"]201[/TD]
[TD="align: right"]250[/TD]
[/TR]
[TR]
[TD="align: right"]251[/TD]
[TD="align: right"]300[/TD]
[/TR]
[TR]
[TD="align: right"]301[/TD]
[TD="align: right"]400[/TD]
[/TR]
[TR]
[TD="align: right"]401[/TD]
[TD="align: right"]500[/TD]
[/TR]
[TR]
[TD="align: right"]501[/TD]
[TD="align: right"]600[/TD]
[/TR]
[TR]
[TD="align: right"]601[/TD]
[TD="align: right"]700[/TD]
[/TR]
[TR]
[TD="align: right"]701[/TD]
[TD="align: right"]800[/TD]
[/TR]
[TR]
[TD="align: right"]801[/TD]
[TD="align: right"]900[/TD]
[/TR]
[TR]
[TD="align: right"]901[/TD]
[TD="align: right"]1000[/TD]
[/TR]
</tbody>[/TABLE]
 
i take it you need to check each of those and see which range they fall in?
Excel Workbook
ABCDEF
1numberwhich range is it in?lower of rangeupper of rangerange name
200-500500-50
3360-50517551-75
4500-507610076-100
59576-100101150101-150
6245201-250151200151-200
7352301-400201250201-250
8357301-400251300251-300
9379301-400301400301-400
10406401-500401500401-500
115151-75501600501-600
12500-50601700601-700
131000901-1000701800701-800
141001out of range801900801-900
159011000901-1000
16401401-5001001out of range
Sheet1
 
Upvote 0
This formula seems to work the best. Here is what I am using in my sheet: =LOOKUP((D20-$D$20),$L$2:$L$15,$M$2:$M$15). My results are shown below and I need to be able to use the multiple from that range in my final algorithm so essentially if that range is 0-50 then i need the final value to return the third number which is the RETURN NUMBER:
LOWER / UPPER / RETURN NUMBER
[TABLE="width: 122"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD="align: right"]0[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"].25%[/TD]
[/TR]
[TR]
[TD="align: right"]51[/TD]
[TD="align: right"]75[/TD]
[TD="align: right"].50%[/TD]
[/TR]
[TR]
[TD="align: right"]76[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]1%[/TD]
[/TR]
[TR]
[TD="align: right"]101[/TD]
[TD="align: right"]150[/TD]
[TD="align: right"]2%[/TD]
[/TR]
[TR]
[TD="align: right"]151[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]2.5%[/TD]
[/TR]
[TR]
[TD="align: right"]201[/TD]
[TD="align: right"]250[/TD]
[TD="align: right"]3%[/TD]
[/TR]
[TR]
[TD="align: right"]251[/TD]
[TD="align: right"]300[/TD]
[TD="align: right"]4%[/TD]
[/TR]
[TR]
[TD="align: right"]301[/TD]
[TD="align: right"]400[/TD]
[TD="align: right"]5%[/TD]
[/TR]
[TR]
[TD="align: right"]401[/TD]
[TD="align: right"]500[/TD]
[TD="align: right"]7%[/TD]
[/TR]
[TR]
[TD="align: right"]501[/TD]
[TD="align: right"]600[/TD]
[TD="align: right"]9%[/TD]
[/TR]
[TR]
[TD="align: right"]601[/TD]
[TD="align: right"]700[/TD]
[TD="align: right"]10%[/TD]
[/TR]
[TR]
[TD="align: right"]701[/TD]
[TD="align: right"]800[/TD]
[TD="align: right"]13%[/TD]
[/TR]
[TR]
[TD="align: right"]801[/TD]
[TD="align: right"]900[/TD]
[TD="align: right"]15%[/TD]
[/TR]
[TR]
[TD="align: right"]901[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]16%[/TD]
[/TR]
</tbody>[/TABLE]

Spreadsheet Formulas
CellFormula
B2=IF(A2="","",LOOKUP(A2,$C$2:$C$16,$E$2:$E$16))

<tbody>
</tbody>

<tbody>
</tbody>

VALUES RETURNED WITH ABOVE FORMULA:
[TABLE="width: 59"]
<colgroup><col></colgroup><tbody>[TR]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD="align: right"]250[/TD]
[/TR]
[TR]
[TD="align: right"]400[/TD]
[/TR]
[TR]
[TD="align: right"]400[/TD]
[/TR]
[TR]
[TD="align: right"]400[/TD]
[/TR]
[TR]
[TD="align: right"]500[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
instead of range name like
[FONT=Calibri, Arial]0-50[/FONT]
[FONT=Calibri, Arial]put the percentages in that column you really don't need upper any way
or just change the formula to retrieve the correct column

[/FONT]=LOOKUP((D20-$D$20),$L$2:$L$15,$N$2:$N$15)
where column L has the lower limit and column N the percentages
 
Upvote 0

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