Return value adjacent based on match

cms90740

New Member
Joined
Apr 26, 2016
Messages
12
Hi all,

I believe I've done something similar to my current problem but I can't quite figure this one out. Would appreciate any advice!

I'm trying to match 2 values in different columns and then return the adjacent value from a third column. Hopefully this demonstrates it clearly.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]title[/TD]
[TD]value[/TD]
[TD]titles[/TD]
[TD]value[/TD]
[/TR]
[TR]
[TD]green[/TD]
[TD][/TD]
[TD]green[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]orange[/TD]
[TD][/TD]
[TD]blue[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]green[/TD]
[TD][/TD]
[TD]red[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]red[/TD]
[TD][/TD]
[TD]orange[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]


I'd like to create a formula for column B that matches column A against column C and returns the corresponding value in column D. For instance, B2 would equal 1, B3 would equal 4, B4 would equal 1, and B5 would equal 3. Hope that makes sense. Thanks in advance for your help!
 
Last edited:

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Assuming no dup;icates in column C try VLOOKUP.
Excel Workbook
ABCD
1titlevaluetitlesvalue
2green1green1
3orange4blue2
4green1red3
5red3orange4
Sheet
 
Upvote 0
Assuming no dup;icates in column C try VLOOKUP.

ABCD
greengreen
orangeblue
greenred
redorange

<colgroup><col style="width:30px; "><col style="width:67px;"><col style="width:66px;"><col style="width:71px;"><col style="width:76px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]
[TD="bgcolor: #c0c0c0"]title[/TD]
[TD="bgcolor: #c0c0c0"]value[/TD]
[TD="bgcolor: #c0c0c0"]titles[/TD]
[TD="bgcolor: #c0c0c0"]value[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffff00]#ffff00[/URL] , align: center"]1[/TD]

[TD="align: right"]1[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffff00]#ffff00[/URL] , align: center"]4[/TD]

[TD="align: right"]2[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffff00]#ffff00[/URL] , align: center"]1[/TD]

[TD="align: right"]3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]5[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffff00]#ffff00[/URL] , align: center"]3[/TD]

[TD="align: right"]4[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
B2=VLOOKUP(A2,$C$2:$D$5,2,0)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

This worked perfectly, thank you!
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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