vlookup if cell is NOT blank

unityjon

New Member
Joined
Jan 12, 2005
Messages
47
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi all,

I am having an issue changing a formula that works to do something else if the reference cell is actually blank ( i have searched and not found a similar scenario ?)
My working formula is this:

Excel Formula:
=IFERROR(VLOOKUP(J16,ad_users_03112022!$A$1:$B$1213,2,FALSE),"NOADACCOUNT")
It will look at J16 (in this instance) and vlookup in the different sheet and return either the corresponding entry or 'noadaccount' as it should.
The trouble i'm having is this is a bit of a mess where j16 has a blank entry, i need it to return nothing i.e ""
so i changed the formula to this:
Excel Formula:
=IF(J16="", "", IF(VLOOKUP(J16,ad_users_03112022!$A$1:$B$1213,2,FALSE),"NOADACCOUNT")
unfortunately this returns a #value error stating

"Error in Value
A value used in the formula is of the wrong data type."

could this be an issue with the sheet formatting or an issue with the formula ? i'm really stumped on this.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Maybe
Excel Formula:
=if(J16="","",IFERROR(VLOOKUP(J16,ad_users_03112022!$A$1:$B$1213,2,FALSE),"NOADACCOUNT"))
 
Upvote 0
Solution
@Fluff
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Maybe
Excel Formula:
=if(J16="","",IFERROR(VLOOKUP(J16,ad_users_03112022!$A$1:$B$1213,2,FALSE),"NOADACCOUNT"))
sorry, yes you are quite right, its been such a long time since i've used these boards. i'll update immediatley
Thank you for the syntax change, my oversight :( very much appreciated, it works.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,397
Members
449,081
Latest member
JAMES KECULAH

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