ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   formulas that may sometimes contain empty cells (https://www.excelbanter.com/excel-worksheet-functions/218229-formulas-may-sometimes-contain-empty-cells.html)

chrisnsmith

formulas that may sometimes contain empty cells
 
How do you get a formula that contains empty cells to ingnore the formula and
return a value of 0 (zero)

Gary''s Student

formulas that may sometimes contain empty cells
 
Say we are adding A1 thru A10, but if any are blank, report 0 instead:

=IF(COUNTBLANK(A1:A10)0,0,SUM(A1:A10))

So you will see 0 until all the data is filled in.
--
Gary''s Student - gsnu200829


"chrisnsmith" wrote:

How do you get a formula that contains empty cells to ingnore the formula and
return a value of 0 (zero)


Shane Devenshire[_2_]

formulas that may sometimes contain empty cells
 
Hi,

This really depends on the formula. In general cells that are empty are
treated as 0. For example =SUM(A1:A10) returns 0 if all the cells are empty.
On the other hand

=AVERAGE(A1:A10)

returns DIV/0 if all the cells are empty. In that case you could use
=AVERAGEIF(A1:A10,"<") in 2007
or in 2003
IF(COUNT(A1:A10)0,AVERAGE(A1:A10),0)

We need to see your formula.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"chrisnsmith" wrote:

How do you get a formula that contains empty cells to ingnore the formula and
return a value of 0 (zero)



All times are GMT +1. The time now is 12:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com