finding a string in an array, and getting the value next to it?

deLockloire

Board Regular
Joined
Apr 4, 2008
Messages
110
Office Version
  1. 365
Platform
  1. Windows
hi,

i'd like to find a string in a table (e.g., A1:H200). the string can be anywhere within this table. once the string is found, i'd like to get the data from the next cell to the right (e.g., if the string is found in F32, then i'd like the formula to show the content of G32).

if necessary, i can arrange the workbook in a way, that the string to be found will be either in column A or in column F. this narrows down the number of columns where i can search for the string.

any ideas?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
If you were working with one column, VLOOKUP would be the way to go.

In the A, F scenario, if there is only one cell with theString and the cell next to it is text, a formula like this would work.
=IF(ISNUMBER(MATCH("theString,A1:A200,0),VLOOKUP("theString",A1:A200,2,False),"") & IF(ISNUMBER(MATCH("theString,F1:F200,0),VLOOKUP("theString",F1:F200,2,False),"")

If the cell next to theString is numeric, change "" to 0 and & to + in the formula.
 
Upvote 0
good idea. much better than my original, because this way i can use the same string in the A and the F columns. :)

thanks.
 
Upvote 0

Forum statistics

Threads
1,215,479
Messages
6,125,041
Members
449,206
Latest member
Healthydogs

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