Excel formmula to determine which range of value a certain number falls between

subby

New Member
Joined
Sep 24, 2010
Messages
11
Hi All,

I need to figure out how to avoid nested IF-s because I have to determine if the value of cell A1 falls between one of the 20-ish ranges of values, and and return a value based on the result

So the cell A1 can contain any integer between 0 and 375
the ranges for which I have to determine if A1's value falls into are (inclusive): 0-14, 15-29, 30-44, 45-59, 60-74, 75-89, 90-104, 105-119, 120-134, 135-149, 150-164, 165-179, 180-194, 195-209, 210-224, 225-239, 240-254, 255-269, 270-284, 285-299

For example if A1 is 229, then the result should be the cell that is below the one that says "225-239", which is 17 500.

Can somebody please suggest a fromula OR VBA solution for me?
 

Attachments

  • excel-table.png
    excel-table.png
    175.7 KB · Views: 82

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
It would be easier if you could alter the values in row 1 to reflect the start value for each range. Then a simple LOOKUP formula would suffice.

Otherwise you'll need something like:

Excel Formula:
=LOOKUP(A2,--LEFT($E$1:$W$1,FIND("-",$E$1:$W$1)-1),E2:W2)
 
Upvote 0
Solution
It would be easier if you could alter the values in row 1 to reflect the start value for each range. Then a simple LOOKUP formula would suffice.

Otherwise you'll need something like:

Excel Formula:
=LOOKUP(A2,--LEFT($E$1:$W$1,FIND("-",$E$1:$W$1)-1),E2:W2)
Hi RoryA,

Thank you very much!

This works perfectly!!

Justt out of curiosity, how would the LOOKUP work if only the starting value of the range were in row 1? (see the attached picture)

Thank you for your answear!

Subby
 

Attachments

  • excel-table-rev1.png
    excel-table-rev1.png
    171.9 KB · Views: 58
Upvote 0
It would then just be:

Excel Formula:
=LOOKUP(A2,$E$1:$W$1,E2:W2)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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