If(and( using vlookup

brooksc29

Active Member
Joined
Jul 25, 2010
Messages
331
I'm trying to say if "Vlookup1"=0 and "Vlookup2"=0, then leave blank, if not, the Vlookup3... however, it's returning 0 and not " ".

=IF(AND(VLOOKUP($L4,PITCHERScompLIST,93,FALSE)=0,
VLOOKUP($L4,PITCHERScompLIST,94,FALSE)=0),"",
VLOOKUP($L4,PITCHERScompLIST,93,FALSE))

what am I doing wrong here?
 

Some videos you may like

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

rallcorn

Well-known Member
Joined
Nov 11, 2008
Messages
1,027
Is "PITCHERScompLIST" a defined Name Range? If it isn't, that's where your problem lies. You need to be referring to a range of cells.

The concept you're using works - I tested it using this formula:
=IF(AND(VLOOKUP(A1,A6:C7,2,FALSE)=0,VLOOKUP(A1,A6:C7,3,FALSE)=0),"",VLOOKUP(A1,A6:C7,2,FALSE))
 

brooksc29

Active Member
Joined
Jul 25, 2010
Messages
331
Yes, it is a named range... I realize now why I am still getting 0 back in some circumstances... stupid mistake by me. The AND function requires it to be true for both cases, and that's essentially what I need it to do, just going to have to live with a few 0's on occasion.

thanks for your help
 

Watch MrExcel Video

Forum statistics

Threads
1,128,020
Messages
5,628,181
Members
416,297
Latest member
Kara Payne

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
Top