ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Adding cells but leaving blank if not populated (https://www.excelbanter.com/excel-worksheet-functions/247611-adding-cells-but-leaving-blank-if-not-populated.html)

Scoober

Adding cells but leaving blank if not populated
 
I am trying to add cells C5 thru I5 to populate J5, I would like J5 to remain
blank if no figures are entered into cell C5 thru I5 instead of having a zero

I have tried the following:

=IF(OR(C5="",D5="",E5="",F5="",G5="",H5="",I5=""), "",(C5+D5+E5+F5+G5+H5+I5))

But this formula only leaves a blank J5 and will not add (say) C5 and F5 if
the other cells in the formula are empty.

Where am I going wrong?


--
Thanks in advance.

Scoober

Jacob Skaria

Adding cells but leaving blank if not populated
 
Replace OR with AND
=IF(AND(C5="",D5="",E5="",F5="",G5="",H5="",I5="") ,"",(C5+D5+E5+F5+G5+H5+I5))

'Using SUM()
=IF(SUM(C5:I5),SUM(C5:I5),"")

If this post helps click Yes
---------------
Jacob Skaria


"Scoober" wrote:

I am trying to add cells C5 thru I5 to populate J5, I would like J5 to remain
blank if no figures are entered into cell C5 thru I5 instead of having a zero

I have tried the following:

=IF(OR(C5="",D5="",E5="",F5="",G5="",H5="",I5=""), "",(C5+D5+E5+F5+G5+H5+I5))

But this formula only leaves a blank J5 and will not add (say) C5 and F5 if
the other cells in the formula are empty.

Where am I going wrong?


--
Thanks in advance.

Scoober


David Biddulph[_2_]

Adding cells but leaving blank if not populated
 
=IF(COUNT(C5:I5),SUM(C5:I5),"")
--
David Biddulph

Scoober wrote:
I am trying to add cells C5 thru I5 to populate J5, I would like J5
to remain blank if no figures are entered into cell C5 thru I5
instead of having a zero

I have tried the following:

=IF(OR(C5="",D5="",E5="",F5="",G5="",H5="",I5=""), "",(C5+D5+E5+F5+G5+H5+I5))

But this formula only leaves a blank J5 and will not add (say) C5 and
F5 if the other cells in the formula are empty.

Where am I going wrong?





All times are GMT +1. The time now is 02:37 AM.

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