Solved

Excel Formula - If And on Blank Cell

Posted on 2016-11-11
7
24 Views
Last Modified: 2016-11-15
I have an excel database I created to use with Tableau to calculate my Net Promoter Score (NPS) for my CSI results.  The Formula is:

=IF(AND(I2<7,I2=""),1,0)

The result I need is If the cell is less than 7 input a 1, if it is a blank, input a 0.  It is not working, it only enters a 0 for everything.   What am I doing wrong?
0
Comment
Question by:mikesautobody
  • 3
  • 3
7 Comments
 
LVL 25

Expert Comment

by:Shaun Kline
Comment Utility
To perform this type of logic, you need to use nested IF statements:
=IF(I2<7,1,IF(I2="", 0))

Open in new window


The question becomes: What happens if I2 is equal to or greater than 7?
0
 

Author Comment

by:mikesautobody
Comment Utility
I tried that as well, it returns a 1 on for the blank cell instead of the 0
0
 
LVL 25

Expert Comment

by:Shaun Kline
Comment Utility
Switch the formula around:
=IF(I2="",0,IF(I2<7, 1))

Open in new window

0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:mikesautobody
Comment Utility
That works unless the number in the field is greater than 7, than it returns a FALSE.  I tried nesting a third if statement =IF(I52792="",0,IF(I52792>=7,0),IF(I52792<7,1)) and Excel says "You've returned too many arguments for this function".
0
 
LVL 25

Accepted Solution

by:
Shaun Kline earned 500 total points
Comment Utility
So if the field is blank or equal to/greater than 7, you want 0, else you want 1:
IF(OR(I2="", I2>=7), 0, 1)

Open in new window

1
 
LVL 6

Expert Comment

by:nathaniel
Comment Utility
Going back to your requirement:  

"The result I need is If the cell is less than 7 input a 1, if it is a blank, input a 0"

since you did not specify "what if it is greater than or equal to 7", I assume all other values would be "0"
so then the formula would just be:

=IF(I1<7,1,0)

Open in new window


if you want to add another result value, like if the value is not less than 7 and not Blank then the result would be let's say, "2",
you can use the following:

=IF(I1<7,1,IF(I1="",0,2))

Open in new window

0
 

Author Closing Comment

by:mikesautobody
Comment Utility
Thank you so much.  I knew about If And, did not know about If Or.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now