Multiple IF statements in a VLOOKUP.

gbenson

New Member
Joined
Dec 11, 2018
Messages
2
I am sure this will be very easy, but I am screwing something up in my text. I have this, which works, but I need to add an additional IF statement for <=0. I know this is probably very simple, so any help is appreciated.

=IF(VLOOKUP(F1:F30, [Book2]Sheet1!$A$1:$H$2630,8,0)>=0, "YES", "NO")
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Welcome to the Board!

Firstly, the first argument in the VLOOKUP function should be a single cell, not a whole range. If you want to do it for all of F1:F30, you would copy the formula down 30 times.

To do what you want, you need a nested IF statement, i.e.
Code:
[COLOR=#333333]=IF(VLOOKUP(F1, [Book2]Sheet1!$A$1:$H$2630,8,0)>=0, "YES", [/COLOR][COLOR=#333333]IF(VLOOKUP(F1, [Book2]Sheet1!$A$1:$H$2630,8,0) < 0,""[/COLOR][COLOR=#333333]))[/COLOR]

A few things to note:
1. You are already checking >=0. Can it return anything other than a number? If not, then you don't need to check for less than zero, as number can only be one of the two options, there is no other.
If the concern is it could return an error, you can use the IFERROR statement instead of a nested IF statement.
2. Your original formula says >=0. And then you are asking about <=0. That is overlapping. What do you want to happen if it equals 0 (0 satisifies BOTH those conditions). The equal sign should only appear in one of those options, not both.
 
Upvote 0
Hi Joe, thanks for the help. Yes, I will clean up the formula next time. Removing the 2nd '=' did it.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

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