Next number down in list

bjenks

New Member
Joined
Nov 18, 2006
Messages
17
I am sure this has been asked before, but I can't find anything. Here is the data in each cell:

A1: 1
A2: 4
A3: 8
A4: 12
A5: 13

I am looking for a formula that if I put in the following data at B1 I would get the following Row number:

0, A1
1, A1
3, A2
11, A4
13, A5
15, Error or N/A

I was using MATCH(B1, A1:A5, 1) but now realize it was giving me A3 for 11 instead of A4

I am trying to stay away from VBA or Functions, just formulas.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I am sure this has been asked before, but I can't find anything. Here is the data in each cell:

A1: 1
A2: 4
A3: 8
A4: 12
A5: 13

I am looking for a formula that if I put in the following data at B1 I would get the following Row number:

0, A1
1, A1
3, A2
11, A4
13, A5
15, Error or N/A

I was using MATCH(B1, A1:A5, 1) but now realize it was giving me A3 for 11 instead of A4

I am trying to stay away from VBA or Functions, just formulas.
Try this array formula**:

=INDEX(A1:A5,MATCH(TRUE,A1:A5>=B1,0))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

If the lookup value in B1 is greater than the max value in the range then you'll get an error.
 
Upvote 0
Try this array formula**:

=INDEX(A1:A5,MATCH(TRUE,A1:A5>=B1,0))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

If the lookup value in B1 is greater than the max value in the range then you'll get an error.

Just noticed that I only needed this part of your eqation as I was just looking for the row number:

MATCH(TRUE,A1:A5>=B1,0)

Thanks...
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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