Match function in reverse direction

DrDebit

Board Regular
Joined
May 20, 2013
Messages
123
Office Version
  1. 365
Platform
  1. Windows
Is it possible to use the MATCH function to find the ordinal position of text, but going up instead of going down.

X
Y
Program
A
B
C
Program
R
S
Here

In the cell with "Here" in it, I want to be able to find the position of the first time that the word, "Program," appears, but going up instead of down.

Thank you!
 
Actually I'd misunderstood the question and was giving the last entry for "Project".
If OP needs the last "Project" before "Here" then I think this is it:

Somebody messaged me saying the above didn't work, but it was a misunderstanding of the old posting format. Here is the working XL2BB version.

DrDebit.xlsx
AB
1DataPosition
2X10
3Program
4A
5B
6C
7Program
8R
9R
10Program
11R
12R
13Here
14R
15Program
Sheet1
Cell Formulas
RangeFormula
B2B2=AGGREGATE(14,6,ROW(INDIRECT("$A$1"&":"&ADDRESS(MATCH("Here",$A$1:$A$15,0),1)))/($A$1:$A$15="Program"),1)
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Or without volatile functions May need CSE entry depending on version
+Fluff 1.xlsm
ABC
1X
2Y7
3Program
4A
5B
6C
7Program
8R
9S
10Here
11X
12Y
13Program
14A
15B
16C
17Program
18R
19S
Data
Cell Formulas
RangeFormula
C2C2=LARGE(IF(A1:INDEX(A1:A10,MATCH("here",A1:A10,0))="Program",ROW(A1:A10),""),1)
 
Upvote 0
Or without volatile functions May need CSE entry depending on version
+Fluff 1.xlsm
ABC
1X
2Y7
3Program
4A
5B
6C
7Program
8R
9S
10Here
11X
12Y
13Program
14A
15B
16C
17Program
18R
19S
Data
Cell Formulas
RangeFormula
C2C2=LARGE(IF(A1:INDEX(A1:A10,MATCH("here",A1:A10,0))="Program",ROW(A1:A10),""),1)
Thanks to both of you.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0
Thanks to both of you.
Hi Fluff,

As soon as I increase by range , formula does not recognize it ( i.e. I7 & I8 )

Book1
ABCDEFGHI
2X10#N/A
3Program
4A10AProgram
5B#VALUE!
6CHere
7Program#N/A
8R10#N/A
9R
10Program
11R
12R
13Here
14R
15Program
Sheet1
Cell Formulas
RangeFormula
B2B2=AGGREGATE(14,6,ROW(INDIRECT("$A$1"&":"&ADDRESS(MATCH("Here",$A$1:$A$15,0),1)))/($A$1:$A$15="Program"),1)
D2D2=LARGE(IF(A1:INDEX(A1:A10,MATCH("here",A1:A10,0))="Program",ROW(A1:A10),""),1)
F4,E8F4=AGGREGATE(14,6,ROW(INDIRECT("A2"&":"&ADDRESS(MATCH("Here",$A$2:$A$15,0),1)))/($A$2:$A$15="Program"),1)
H4H4=A2:INDEX($A$2:$A$15,COUNT(A2:A15))
C5C5=AGGREGATE(14,6,INDEX(A2:INDEX($A$2:$A$15,MATCH("Here",$A$2:$A$15,0),1)/($A$2:$A$15="Program"),1))
E6E6=INDEX($A$2:$A$15,MATCH("Here",$A$2:$A$15,0))
I7I7=LARGE(IF(A1:INDEX($A$1:$A$15,MATCH("Here",$A$1:$A$15,0))="Program",ROW(A1:A15),""),1)
I8I8=LARGE(IF(A1:INDEX(A1:A10,MATCH("here",A1:A10,0))="Program",ROW(A1:A10),""),1)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
How about
Excel Formula:
=AGGREGATE(14,6,ROW(A1:INDEX(A1:A20,MATCH("here",A1:A20,0)))/(A1:A20="Program"),1)
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,954
Members
449,095
Latest member
nmaske

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