Reputation: 11
Hi I am using the following array formula to sum rows AC-AG , I would like to modify it so that it does not sum if an entire row is blank. How would I do this using an array formula since this spreadsheet is tied to a google forum and gets updates often.
I am using this formula at the top of the column.
={"# Boxes of Household Items"; ARRAYFORMULA(SUMIF(IF(COLUMN(AC1:AG1),ROW(AC2:AG)),ROW(AC2:AG),AC2:AG))}
Example Below
The Formula adds up AC through AG and puts them in AR. I want the formula to not put a zero in AR5 since the entire row is blank
Upvotes: 1
Views: 816
Reputation: 2032
In the image above I have numbers in various cells from columns A:E, then I have a formula in cells F1:F3.
To show the sum when all/some of the cells contain numbers, I would do:
=IF(COUNT(A1:E1)>0,SUM(A1:E1),"")
We check IF
there is at least one number using COUNT(A1:E1)>0
. If there is at least one number, we then show the sum using SUM(A1:E1)
otherwise we just show nothing, which is the ""
part.
For you the formula would be this in AR2
:
=IF(COUNT(AC2:AG2)>0,SUM(AC2:AG2),"")
Upvotes: 1