Match with criteria and starting index

mrblister

Board Regular
Joined
Nov 20, 2016
Messages
200
Office Version
  1. 2021
Platform
  1. Windows
Can someone please help me with the following. I would like a formula that returns a position in a range, upon matching the first item that matches criteria BUT only start searching from a given position.

For example, for the following range there are the following values: [0,1,0,1]
If criteria is X>0, and start looking after position 2, then the formula should return: 4

But I can't get it to work. I tried the following formulas, but both of these return: 2.
MATCH(1,(O221:O224>0)*(ROW(range)>2),0)
XMATCH(1,INDEX((O221:O224>0)*(ROW(range)>2),0),0)

It would obviously be easier if I simply entered in a shortened range, but I'm not able to do that (the above formula would be deeply embedded in a much larger formula with dynamic ranges).

Can anyone assist?
 
Last edited:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
The result would be row 4 if the data started in row 1, but in this case you must consider that the data starts in row 221.
Try:

varios 13dic2024.xlsm
OPQ
220
22104
2221
2230
2241
225
Hoja8
Cell Formulas
RangeFormula
Q221Q221=LOOKUP(2,1/(($O$221:$O$224>0)*(ROW($O$221:$O$224)>ROW($O$221)+2)),ROW($O$221:$O$224)-ROW($O$221)+1)
 
Upvote 0
Thank you, but do I edit the position variable by editing the "+2"? If that's the case, if I set it to "+0", then the formula should return "2", but it instead returns "4".
 
Upvote 0
Try:
Book1
AB
204
31
40
51
Sheet2
Cell Formulas
RangeFormula
B2B2=XMATCH(1,(A2:A5>0)*(SEQUENCE(ROWS(A2:A5))>2))
 
Upvote 0
Solution

Forum statistics

Threads
1,224,737
Messages
6,180,657
Members
452,992
Latest member
TokugawaIesuma

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