VLOOKUP with IF or LOOKUP - Which is the right one to use?

shauneyd

New Member
Joined
Sep 24, 2024
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

New to the Forum and only my 2nd post so far.

I have a spreadsheet with multiple Worksheets and quite a lot of rows.

On one of the Worksheets I have the following 2 columns:

WS1.jpg


On the 2nd worksheet I have the following 2 columns:

WS2.jpg


What I am looking to do is on the first worksheet above is use a Formula to check if if the Department exists on the other Worksheet and if it does to return the value of 'Stage work is at'. Now, I am looking to return 'Yes' if it equals 'Complete' and 'No' if it is any other entry (including blanks).

I have been tinkering with VLOOKUP and LOOKUP but just can't seem to return the right result.

Is VLOOKUP right for this (possibly combined with an IF Statement) or should I be using LOOKUP?

Many thanks for any help or advice you can offer on this, I really appreciate it.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
LOOKUP has its uses but is mostly provided for backwards compatibility for older versions of Excel before VLOOKUP (and HLOOKUP) was introduced. Most of the time VLOOKUP is the way to go. (VLOOKUP and HLOOKUP were themselves made obsolete by XLOOKUP in the latest versions.)

I would do this:
Excel Formula:
=IF(VLOOKUP(B2, Sheet2!$A:$B, 2, FALSE)="Complete","Yes","No")
There are probably other more "clever" ways to do this, but it's obvious what this formula is doing.
 
Upvote 0
LOOKUP has its uses but is mostly provided for backwards compatibility for older versions of Excel before VLOOKUP (and HLOOKUP) was introduced. Most of the time VLOOKUP is the way to go. (VLOOKUP and HLOOKUP were themselves made obsolete by XLOOKUP in the latest versions.)

I would do this:
Excel Formula:
=IF(VLOOKUP(B2, Sheet2!$A:$B, 2, FALSE)="Complete","Yes","No")
There are probably other more "clever" ways to do this, but it's obvious what this formula is doing.
Thank you so much 6StringJazzer, I am 'almost' there with that one. It is working great but I am getting #N/A when the Department is not found on the other sheet.

I'll try and see if I can add something to your formula to prevent returning those values.

I really appreciate your help with this, thank you for taking the time.
 
Upvote 0
This returns a blank if the department is not found. I'm pretty sure IFERROR is available in 2016 but if not let me know.

Rich (BB code):
=IFERROR(IF(VLOOKUP(B2, Sheet2!$A:$B, 2, FALSE)="Complete","Yes","No"),"")
 
Upvote 0
Solution
This returns a blank if the department is not found. I'm pretty sure IFERROR is available in 2016 but if not let me know.

Rich (BB code):
=IFERROR(IF(VLOOKUP(B2, Sheet2!$A:$B, 2, FALSE)="Complete","Yes","No"),"")
Brilliant 6StringJazzer. This works absolutely perfect, thank you so much. I am very grateful to you.
 
Upvote 0

Forum statistics

Threads
1,224,884
Messages
6,181,573
Members
453,054
Latest member
arz007

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