IfError combined with Countblank

julhs

Active Member
Joined
Dec 3, 2018
Messages
471
Office Version
  1. 2010
Platform
  1. Windows
Just want to be sure that the below is the correct way to structure the formula, or is there a better way?
In N21 I have this that is working:
Excel Formula:
=IFERROR(IF(COUNTBLANK(N16:N19)="","",(((((N16*1000)/N17)/(N19/N17))*N18)/N20)*M20),"Entries above are incomplete")
Without using
Rich (BB code):
“IFERROR”
and
Rich (BB code):
“IF(COUNTBLANK(N16:N19)="","",”
then the calculation
Rich (BB code):
(N16*1000)/N17)/(N19/N17))*N18)/N20)*M20
results in a
Rich (BB code):
#Value error”
if any cell in N16:N19 is blank.

Is there a better formula?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
That can't be working because COUNTBLANK always returns a number, even if it is 0. It would never return an empty string.

But I suspect, this would do what you want:
=IF(COUNT(N16:N19)=4,(((((N16*1000)/N17)/(N19/N17))*N18)/N20)*M20,"Entries above are incomplete")
 
Upvote 0
Solution
Hi Scout, thank you for response.
But;
Excel Formula:
=IFERROR(IF(COUNTBLANK(N16:N19)="","",(((((N16*1000)/N17)/(N19/N17))*N18)/N20)*M20),"Entries above are incomplete")
IS working if any cell in N16:N19 is “Blank”, aka ””, (eg: no formula, no nothing)
With my formula; N21 is returning "Entries above are incomplete" if any cell in N16:N19 is “Blank”.
This is about, is there a better way to write the formula, than the formula itself not work?
 
Upvote 0
It's not working because of the COUNTBLANK, it's working because of the ISERROR (probably #DIV/0!). Your COUNTBLANK will never return TRUE.

Did you try my formula?
 
Upvote 0
Hi Scott
Based on what you said in post #2 about CountBlank I played around with changes to my formula.
You of coarse where right in that the way I’d used the Countblank couldn’t work (didn’t understand how it worked, never used it before), but it transpires that the way I had used it it DIDN’T actually do anything other than give me the correct number of arguments in the formula for it to compute.

And again your right on this; what infact made it appear that the Countblank part was working had nothing to do with Countblank it was actually the IFERROR part.
This is my rejigged formula that works in N21 just using IFERROR to prevent a #DIV error if any of N16:N19 are blank;
Excel Formula:
= IFERROR(((((N16*1000)/N17)/(N19/N17))*N18)/N20*M20,"Entries above are incomplete ")

And then I have your COUNTBLANK way;
Excel Formula:
=IF(COUNT(N16:N19)=4,(((((N16*1000)/N17)/(N19/N17))*N18)/N20)*M20,"Entries above are incomplete ")

Will use yours as it eliminates the #DIV error in the first place, rather than handle the error with IFERROR
Many thanks for your help.
Julhs
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,681
Members
452,937
Latest member
Bhg1984

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