How to return value if any cells are blank

megera716

Board Regular
Joined
Jan 3, 2013
Messages
142
Office Version
  1. 365
Platform
  1. Windows
I have 3 columns of data with my formula in column 4. If any of the 3 columns are blank, I want the formula to return 0. If all 3 have data, then it should return 50.

Here's my formula, which I am doing as an array: {=IF(ISBLANK(Table1[@[1]:[3]]),"","50")}. But on the row in red text, it is returning 50 even though column 3 is blank (and yes, it is completely blank, not a formula returning a blank).


1234
01/23/201801/26/2018X50
X
X
01/25/201801/26/2018X50
X
01/24/201801/24/201850
01/15/201801/26/2018X50
01/25/201801/26/2018X50

<tbody>
</tbody>
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Thanks!! That worked, although I don't know how it worked without it being IF COUNTA = 3?
 
Upvote 0
Actually, scratch that. it still returned 50 for one row where column 3 was blank (but curiously enough, it correctly did NOT return the 50 for the row that was returning 50 before) :confused:.
 
Upvote 0
it still returned 50 for one row where column 3 was blank
Are you sure it is really blank (and doesn't contain something like a single space)?
You can easily confirm that with the LEN function.
If it is cell C2, then:
=LEN(C2)
should return 0. If it does not, then the cell is not really blank.
 
Upvote 0
Well that's embarrassing. That fixed it Joe. There were indeed spaces in the cells - how annoying (it was a download from a website but I don't know why it would have a space in it!).
 
Upvote 0
it was a download from a website but I don't know why it would have a space in it!
It is actually quite common. There are often non-typical characters too, like non-breaking spaces on files download from the web.
 
Upvote 0
I don't know how it worked without it being IF COUNTA = 3?
To answer this question, it is taking advantage of the fact that it is a Boolean expression.
If you set two things equal to each other, than is either a TRUE statement or a FALSE statement.
TRUE has a numerical equivalent of 1, and FALSE has a numerical equivalent of 0.

To see this, first try these two expressions:
=1=1
=1=0

This is pretty obvious, and you will get TRUE and FALSE respectively, for your answers.

Now add this to each one:
=(1=1)*50
=(1=0)*50
and note the answers (which shows how TRUE=1 and FALSE=0).
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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