Vlookup and IF statements

GrayMPA

Board Regular
Joined
Dec 10, 2003
Messages
95
I use Vlookup a lot, and often inside IF statements. My formula runs something like this: =IF (Vlookup(a1, Othersheet!A1:f300,2,false)="Wave",1,(Vlookup(a1,othersheet!A1:f300,2,false)). Do I have to keep using the vlookup function at both sides of the IF statement? Is there a better way/idea to handle these kinds of problems?

Thanks in advance

Bob
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi Bob,

Why are you using an IF statement? Couldn't you replace "Wave" with 1 in your othersheet list?

I often use something like =IF(ISERROR(Vlookup(a1,othersheet!A1:f300,2,false),"Not found",Vlookup(a1,othersheet!A1:f300,2,false)) to replace #N\A with something ledgible.

Let me know,

Bruce
 
Upvote 0
Upvote 0
Thaks Brian.

I actually got caught in a bad thread some time ago because of ISERROR versus ISNA etc on my lookups. I've learn't my lesson.

No reply from Bob yet.

PS What Hawaii like in March/April?

Cheers, Bruce
 
Upvote 0
Actually, what I get from the Vlookup function is a number. If it is a number, I need to get other information. If it is not, I can stop.

What I am trying to do is pull information from a production schedule. The schedule only tells me what I am to run; I have to look on other databases to find what additional supplies I need. These other databaases are not linked or easily accessible, so I cant pull directly from them. Besides, I am doing this on the sly - the computer folks don't know I am doing this. My aim is to give my people on the floor the ability to pull all the information they need at one time, and not waste time looking for it. If I can prove this saves time, I think I can get the computer folks to hard wire this process. Writing this macro isnt my full time job.
 
Upvote 0
Bob,

Welcome to the justification club! I seem to spent a lot of time building reports in Excel with vba Macros then passing details on to IT. Lucky for me our IT reporting team includes an ex-analyst from our team so we have an insider. :wink:

Did you know that VLookup alone gives a single dimensional result (ie lookup one value return another) but a combination with HLookup or the way I do it, using Offset and Match functions can give a result from 2 dimensions. For example; if you have a table with staff names down the left and product categories across the top (ie pivot table) then you can "lookup" the number of sales in a chosen category, by staff member.

Good luck,

Bruce
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,851
Members
449,051
Latest member
excelquestion515

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