when you have too many conditions to use IF

curious1

Board Regular
Joined
Jul 22, 2005
Messages
58
Office Version
  1. 365
Platform
  1. Windows
I want to determine between which values, in colB, cell A1 falls and report the higher end of the range from colB. So, say A1=789 and col B is the array of numbers below. I would like a function that returns 999.

I thought I could use a nested vlookup with a range lookup of TRUE but that forces the return of the lower value in the range, not the higher. Maybe MAX? Stumped.

299
399
549
749
999
1299
1499
1749
1999
2499
2999
3499
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Like this?

Excel Workbook
ABCD
1789299999
2399
3549
4749
5999
61299
71499
81749
91999
102499
112999
123499
Sheet5
 
Upvote 0
Also...

=SMALL(B1:B12,COUNTIF(B1:B12,"<="&A1)+1)

If B1:B12 sorted...

=INDEX(B1:B12,MATCH(A1,B1:B12,1)+(LOOKUP(A1,B1:B12)<=A1))
 
Upvote 0
curious1

You just need to check what result you want if A1 is exactly equal to a value in column B. My formula and Aladin's produce different results in this circumstance. As well as checking, say, 999 in A1 also check 3499 - if it is possible that A1 can be that value.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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