?
Solved

Excel Formula - If And on Blank Cell

Posted on 2016-11-11
7
Medium Priority
?
52 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 26

Expert Comment

by:Shaun Kline
ID: 41884124
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
ID: 41884131
I tried that as well, it returns a 1 on for the blank cell instead of the 0
0
 
LVL 26

Expert Comment

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

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:mikesautobody
ID: 41884152
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 26

Accepted Solution

by:
Shaun Kline earned 2000 total points
ID: 41884156
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
ID: 41885999
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
ID: 41888469
Thank you so much.  I knew about If And, did not know about If Or.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

762 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