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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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,214,956
Messages
6,122,465
Members
449,085
Latest member
ExcelError

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