Find match and return adjacent cell

Chris_1

New Member
Joined
Dec 23, 2024
Messages
6
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hello,

Sorry I have web version and cannot figure out how to paste actual excel example.
I am trying to figure out how to find the word JOB: and get the result next to it.
I have a constant. It is always on row 3
Problems. Not in a table. It moves columns and needs to be concatenated.
1734998272453.png

Any suggestions would be much appreciated.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Finding the Value "JOB:" is no problem but the "result next to it" is.
Is that left ("BILL") of it or right ("BIG") of it?
 
Upvote 0
Code:
Sub Maybe_So()
    MsgBox ActiveSheet.Rows(3).Find("JOB:", , , 1).Offset(, -1).Value
End Sub

Code:
Sub Or_Maybe_So()
    MsgBox ActiveSheet.Rows(3).Find("JOB:", , , 1).Offset(, 1).Value
End Sub

Code:
Sub Or_Maybe_So_Even()
    MsgBox ActiveSheet.Rows(3).Find("JOB:", , , 1).Offset(1).Value
End Sub
 
Upvote 0
Put this formula in B5 (and B11 maybe)
Excel Formula:
=R[-2]C[2]&" "&R[-2]C[3]&" "&R[-2]C[4]

I don't know if you can run a macro on a "leased" excel.

If you find out that you can and find out how to install/run a macro, this would give the same result as the formula.
Code:
Sub Or_So_Concat()
    With ActiveSheet.Rows(3).Find("JOB:", , , 1)
        .Offset(2, -1).Value = .Offset(, 1).Value & " " & .Offset(, 2).Value & " " & .Offset(, 3).Value
    End With
End Sub
 
Upvote 0
I'm not sure if I'm misunderstanding your requirement or not (and I'm sure there's a more elegant solution than this) but see if this gets close to what you want:

Book1
ABCDEFGHIJKLMN
3JOB:BIGMALLJOB
4
5JOB:BIG MALL JOB
6
7
8
9JOB:BIGHOUSEJOB
10
11JOB:BIG HOUSE JOB
12
13
14
15JOB:smallMALLJOB
16
17JOB:small MALL JOB
18
Sheet1
Cell Formulas
RangeFormula
B5,B17,B11B5=IFERROR(TEXTJOIN(" ",TRUE,OFFSET(INDIRECT(CELL("address",INDEX(C3:Z3,MATCH("JOB:",C3:W3,0)))),0,1,1,20),""),"")
 
Upvote 0
Solution
I'm not sure if I'm misunderstanding your requirement or not (and I'm sure there's a more elegant solution than this) but see if this gets close to what you want:

Book1
ABCDEFGHIJKLMN
3JOB:BIGMALLJOB
4
5JOB:BIG MALL JOB
6
7
8
9JOB:BIGHOUSEJOB
10
11JOB:BIG HOUSE JOB
12
13
14
15JOB:smallMALLJOB
16
17JOB:small MALL JOB
18
Sheet1
Cell Formulas
RangeFormula
B5,B17,B11B5=IFERROR(TEXTJOIN(" ",TRUE,OFFSET(INDIRECT(CELL("address",INDEX(C3:Z3,MATCH("JOB:",C3:W3,0)))),0,1,1,20),""),"")
I dont understand what you have done here yet but the magic works.
I assumed it was an index/match thing but could not figure out how to respond with adjacent cell data.
You even got the concat to work.
What does the "address" in the formula do?
Thank you!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,858
Messages
6,181,431
Members
453,040
Latest member
Santero

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