Vlookup & IF Help

paul_r26

New Member
Joined
May 25, 2010
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I hope you are having a nice day.

Please could you help me! In the below I would like to add in that if the vlookup finds "nights" to show nothing. Is that possible?

=VLOOKUP($B$2,INDIRECT($D6&"!$A:$K"),3,FALSE)

Many thanks
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
What version of Excel are you using? I have a solution in mind, but it involves some of the newer functions available in newer versions of Excel.

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’).
 
Upvote 0
I will just post both functions.

Assuming your original formula works, this should so what you want in all versions of Excel:
Excel Formula:
=IF(VLOOKUP($B$2,INDIRECT($D6&"!$A:$K"),3,FALSE)="nights","",VLOOKUP($B$2,INDIRECT($D6&"!$A:$K"),3,FALSE))

If you have Excel 365, you can use the new LET function to shorten it, i.e.
Excel Formula:
=LET(x,VLOOKUP($B$2,INDIRECT($D6&"!$A:$K"),3,FALSE),IF(x="nights","",x))
 
Upvote 0
Solution
Apologies, is this it:

Microsoft® Excel® for Microsoft 365 MSO (Version 2308 Build 16.0.16731.20496) 64-bit
 
Upvote 0
You are welcome. So did that do what you need?

Apologies, is this it:

Microsoft® Excel® for Microsoft 365 MSO (Version 2308 Build 16.0.16731.20496) 64-bit
If you update your Profile, as described in my first post, it will always show under your name, and you won't need to mention it in every thread.

It will show up like mine:
1708093431171.png
 
Upvote 0

Forum statistics

Threads
1,215,084
Messages
6,123,021
Members
449,092
Latest member
ikke

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