Vlookup only when neighbouring cell has data

coughoxford

New Member
Joined
Aug 3, 2022
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hi , I am trying to remember a simple formula I prepared many years ago but am missing a stage ... I have a excel spreadsheet where I want a vlookup to work in cell C2 only when there is data in B2 . I have tried using = if(b2,"",(vlookup(b2,datasheet!A:E,5,false)) but it doesnt return anything even though I have checked the data is there . It will be someone thing simple but am stuck ! TYIA
 

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.
IF formulas have two three clauses:
- the condition(s) to check
- what to return if conditions met
- what to return if conditions NOT met
The third clause is optional, and if left blank, will return FALSE.

If you want it to return nothing instead, change your formula to this:
=IF(B2 <>"",VLOOKUP(B2,Sheet2!A:E,5,FALSE),"")
 
Upvote 0
Solution
IF formulas have two three clauses:
- the condition(s) to check
- what to return if conditions met
- what to return if conditions NOT met
The third clause is optional, and if left blank, will return FALSE.

If you want it to return nothing instead, change your formula to this:
=IF(B2 <>"",VLOOKUP(B2,Sheet2!A:E,5,FALSE),"")
Thanks Joe ... all sorted
 
Upvote 0
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

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