Should be simple, but missing something - Formula or VBA to return value 4 columns over from searched text

pete3636

New Member
Joined
Jul 20, 2015
Messages
5
I am working with a large spreadsheet that contains specific names and 4 columns over contains a numerical value. What I would like to be able to do is search for the specific text and then have the formula return the value to the right.

Example:

Pete is located in cell C4, C12, E1, G5.

In column G4 is a numeric value - this should be returned for the Pete found in C4

There are various text strings I would have to look up so I would just have to repeat the formula for each different text. I can already do the simple lookup to find pete, I just cannot figure out how to have it return the cell 4 columns over

Any help is greatly appreciated!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Your answer can be found in the OFFSET function, which you could combine with a "find" function. For example,
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD]Jon[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD]Abe[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]12.5[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Code:
Sub findnames
Dim R as Range
Set R = Rows("1:100").Find(What:="Abe", LookIn:=xlFormulas, _ 
     LookAt:=xlPart, SearchOrder:=xlByRows)
If Not R Is Nothing Then
    Range("Z1") = R.value & " amount:"
    Range("Z1").Offset(0,1) = R.Offset(0,4).Value
End if
End sub
In the above example, Z1 = "Abe amount:", AA1 = 12.5
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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