return a value if a cell is between xx & xx

juca73

New Member
Joined
Dec 30, 2017
Messages
40
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
ill try and keep this simple

Cell a3 = 598

i have 3 helper columns to produce the range i want displayed based on the value in cell a3

yet i am struggling to get a formula right

so what im asking i want to search column h3-h27 for the range the value in cell a3 falls into then display the result in cell b3
 

Attachments

  • Screenshot 2023-09-09 202615.png
    Screenshot 2023-09-09 202615.png
    17.7 KB · Views: 13

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Not difficult to solve. Just need 2 things -

~ Use XL2BB tool to post your sample data
~ Update your Account details with Current Excel Version & Platform (Remember to scroll down & Save)

Your Excel Version shows both 365 and 2010 - Both shall have different solution. So update your profile to the latest version you are using.
 
Upvote 0
Your data is a problem because you start by putting the highest number of each range in column F, but starting at -50 you put the lowest number of each range in column F.

The only thing I found that would work is this:

Excel Formula:
=IFERROR(XLOOKUP(A3,$E$3:$E$13,$G$3:$G$13,,1),XLOOKUP(A3,$F$3:$F$27,$G$3:$G$27,,1))

If you clean your data it is possible to get a cleaner formula.
 
Upvote 0
I agree with @6StringJazzer that columns F:G are in an awful order. If you could arrange them so that column F was always the lowest number in the range then the formula is pretty simple

23 09 10.xlsm
ABFGH
1-598a-600-551a
2-150j-550-501b
3-4l-500-451c
40m-450-401d
53n-400-351e
6211r-350-301f
7545x-300-251g
8-250-201h
9-200-151i
10-150-101j
11-100-51k
12-50-1l
1300m
14150n
1551100o
16101150p
17151200q
18201250r
19251300s
20301350t
21351400u
22401450v
23451500w
24501550x
25551600y
Range (2)
Cell Formulas
RangeFormula
B1:B7B1=XLOOKUP(A1,F$1:F$25,H$1:H$25,,-1)


If you must keep F:G in the order you have them then you could try this

23 09 10.xlsm
ABFGH
1-598a-551-600a
2-150j-501-550b
3-4l-451-500c
40m-401-450d
53n-351-400e
6211r-301-350f
7545x-251-300g
8-201-250h
9-151-200i
10-101-150j
11-51-100k
12-50-1l
1300m
14150n
1551100o
16101150p
17151200q
18201250r
19251300s
20301350t
21351400u
22401450v
23451500w
24501550x
25551600y
Range
Cell Formulas
RangeFormula
B1:B7B1=XLOOKUP(A1,IF(A1<-50,F$1:F$25,G$1:G$25),H$1:H$25,,1)
 
Upvote 1

Forum statistics

Threads
1,215,223
Messages
6,123,711
Members
449,118
Latest member
MichealRed

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