Finding the first instance of a given number in a long column from the bottom up

Marvo

Board Regular
Joined
Nov 27, 2023
Messages
174
Office Version
  1. 2021
Platform
  1. Windows
If you have a column of numbers, is there a way of looking up from the bottom to find the first instance of a number higher than the one you place in a box below?

So in the example picture, A11 would be the cell you'd want.
 

Attachments

  • Mr Excel.JPG
    Mr Excel.JPG
    22.3 KB · Views: 18
For that you can use
Excel Formula:
=ADDRESS(XMATCH(A28-0.5,A1:A24,-1,-1),1,4)
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
So the image is from the actual workbook.
The formulas are
Y14: =ADDRESS(XMATCH(ALL!$AG$5559+0.5,ALL!$AG$1:$AG$5558,1,-1)*1,11)
Y16: =ADDRESS(XMATCH(ALL!$AF$5559+0.5,ALL!$AF$1:$AF$5558,1,-1)*1,11)
Y19: =ADDRESS(XMATCH(ALL!$AG$5559-0.5,ALL!$AG$1:$AG$5558,-1,-1)*1,11)
Y21: =ADDRESS(XMATCH(ALL!$AF$5559-0.5,ALL!$AF$1:$AF$5558,-1,-1)*1,11)

These are all producing a result (shown in the image).

Y19 & Y21 are producing the correct result but I think this is because the formula has found a 9 (1 less than 10) and that happens to be the next lowest score.
However Y14 & Y16 are producing an incorrect result as they are looking for 11 (1 more than 10) but are ignoring higher numbers that come before an 11.

So I think I just need to alter the formulas to include greater than > and less than < but I can't find the right position.

This is so close to perfect.
 

Attachments

  • Mr Excel.JPG
    Mr Excel.JPG
    45.8 KB · Views: 9
Upvote 0
I've just realised, the greater than or less than wont work will it as we have been looking to match either 9 or 11. Bugger!
 
Upvote 0
Maybe
Excel Formula:
=ADDRESS(LOOKUP(9^99,IF(A1:A24>A28,ROW(A1:A24))),1,4)
 
Upvote 0
Yes, that all works perfectly. Thank you very much Fluff.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,922
Messages
6,175,384
Members
452,639
Latest member
RMH2024

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