Vlookup in if statement?

Ronix

Board Regular
Joined
Aug 18, 2014
Messages
54
Hi Guys,

let´s imagine this.
In first sheet I have in these three columns A, B, C these values:
Column A:
car
boat
Column B:
red
green
Column C:
automatic
manual
How the statement will look like if I need to get respective value into second sheet to the cell D2 and E2?
If I write to the C2 value "boat" I will automatically get value green to the cell D2 and value manual to the cell E2.
And until the value is not in D2 and E2 these cells are empty.
Thx in advance!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Maybe something like this


Excel 2010
A
B
C
1
car
red
automatic
2
boat
green
manual

<tbody>
</tbody>
Sheet5

Excel 2010
CDE
2boatgreenmanual

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
D2=IF(C2="","",VLOOKUP(C2,Sheet5!A1:C2,2,0))
E2=IF(C2="","",VLOOKUP(C2,Sheet5!A1:C2,3,0))

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Maybe something like this


Excel 2010
ABC
1carredautomatic
2boatgreenmanual

<tbody>
</tbody>
Sheet5

Excel 2010
CDE
2boatgreenmanual

<tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
D2=IF(C2="","",VLOOKUP(C2,Sheet5!A1:C2,2,0))
E2=IF(C2="","",VLOOKUP(C2,Sheet5!A1:C2,3,0))

<tbody>
</tbody>

<tbody>
</tbody>

Great! It works as I need. Thx a lot!
 
Upvote 0

Forum statistics

Threads
1,215,182
Messages
6,123,517
Members
449,102
Latest member
admvlad

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