Reverse Search for Value

rex759

Well-known Member
Joined
Nov 8, 2004
Messages
608
Office Version
  1. 365
Platform
  1. Windows
I thought this was going to be simple but I cannot figure out what direction to take. In column B, I am looking for a formula that will do a search backwards up column C if Column A as the word ID in it.
Column B has the results I am looking for. The number of rows and IDs appear randomly, they are never the same amount between each other. The values always start with H27-.

Any help is appreciated

Book1
ABC
1IDsResultsValue
2H27-12
3
4
5
6IDH27-12
7IDH27-13
8IDH27-14
9IDH27-15
10
11
12
13
14
15H27-18
16IDH27-18
17IDH27-18
18
19
20
21H27-1324
22IDH27-1324
Sheet6
 
That makes it a lot simpler, Peter. It will need a different formula in D2 though, =IF(LEFT($C2,4)="H27-",$C2,$D1)
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
So not opposed to an additional column but the other formula almost worked. B14 should be H27-18

Book1
ABC
1H27-12
2 
3 
4 
5IDH27-12
6IDH27-12
7IDH27-12oil
8IDH27-12
9 
10 Car
11 
12 
13 
14IDH27-12H27-18
15IDH27-18
16IDH27-18
17 train
18 
19 
20 H27-1324
21IDH27-1324
Sheet6 (2)
Cell Formulas
RangeFormula
B2B2=IF(A2="ID",LOOKUP(2,1/(LEFT(C1:C$1,4)="H27-"),C1:C$1),"")
B3:B21B3=IF(A3="ID",LOOKUP(2,1/(LEFT(C$1:C2,4)="H27-"),C$1:C2),"")
 
Upvote 0
=IF(AND(A2="ID",ISNUMBER(SEARCH("h27",C2))),C2,IF(A2="ID",LOOKUP(2,1/(LEFT(C$1:C1,4)="H27-"),C$1:C1),""))
This seems to work, what do you think?
 
Upvote 0
Ok, Once I put it in B1, that did the trick without adding another column. I will apply that to my workbook and see if there are any other roadblocks. I appreciate all your help.
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

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