find a value on the same row, return the cell to the left of it!

ellison

Active Member
Joined
Aug 1, 2012
Messages
356
Office Version
  1. 365
Platform
  1. Windows
Hi all, I'm after a formula to search for a string of text in range which is in the same row, and return the value of the cell to the left of where that value has been found.

So for example cell A contain Names, then row B is where I'd like my "goal" to be, then columns C to G is the range of values that I'd like to use to find my goal.

i.e.
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Names
[/TD]
[TD]Goal
[/TD]
[TD]Col C
[/TD]
[TD]Col D
[/TD]
[TD]Col E
[/TD]
[TD]Col E
[/TD]
[TD]Col F
[/TD]
[TD]Col G
[/TD]
[/TR]
[TR]
[TD]David
[/TD]
[TD]2
[/TD]
[TD]1
[/TD]
[TD]terry
[/TD]
[TD]2
[/TD]
[TD]David
[/TD]
[TD]66
[/TD]
[TD]anthony
[/TD]
[/TR]
[TR]
[TD]Peter
[/TD]
[TD]67
[/TD]
[TD]11
[/TD]
[TD]john
[/TD]
[TD]36
[/TD]
[TD]james
[/TD]
[TD]67
[/TD]
[TD]PETER
[/TD]
[/TR]
</tbody>[/TABLE]

(I'd like to use a formula - as opposed to a macro. And I'd like the search to "not" be case sensistive

I've found a few pointers to do with indexes, matches and offsets, but I'm really struggling!

Best Regards
Neil
 
Last edited:

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.
Hi,

From Column C on, can the same Name appear more than once?

BTW, you have TWO column E in your sample.
 
Upvote 0
Maybe

Excel 2013 32 bit
ABCDEFGH
1NamesGoalCol CCol DCol ECol ECol FCol G
2David21terry2David66anthony
3Peter6711john36james67PETER
Sheet1
Cell Formulas
RangeFormula
B2=INDEX(C2:H2,,MATCH(A2,C2:H2,0)-1)
 
Upvote 0
Crumbs, that's absolutely brilliant. My head will be eternally grateful as I can stop scratching it!:rofl:
 
Upvote 0
Glad we could help & thanks for the feedback.

BTW If you have two or cells with the same name from col C onwards this will simply take the first name.
 
Upvote 0
Since you ignored my question from Post #2 , how about this simple formula using just SUMIF:


Book1
ABCDEFGH
1Names
2David21terry2David66anthony
3Peter6711john36james67PETER
Sheet68
Cell Formulas
RangeFormula
B2=SUMIF(D2:H2,A2,C2:G2)


Formula copied down.
 
Upvote 0
many thanks - and many apologies, wasn't ignoring. All help very much appreciated!
 
Upvote 0
No problem at all, you're very welcome.

SUMIF is the simplest way to go based on your current data.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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