You are viewing limited content. For full access, please sign in.

Question

Question

Summing Numeric Table Column with Formula When Table is Empty

asked on May 17, 2024

I've got a form with a table that has a numeric column.  I've got a total field below the table that sums the numeric column in the table.  If the table (populated by a lookup rule) is empty (no rows) I get a formula error.  How can I avoid the error?

0 0

Answer

SELECTED ANSWER
replied on May 20, 2024 Show version history

=SUMIF(MyTable.TheColumnToBeSummed, ">0", MyTable.TheColumnToBeSummed)

0 0

Replies

replied on May 17, 2024

Have you tried wrapping it in an IF statement? Like:

=IF(INDEX(table_name.field_name, 1) <> "", SUM(your sum funtion), "")

(the ", 1" targets the first row of the table; you could use ROW() if you're checking to see if any rows are blank)

1 0
replied on May 20, 2024

Thanks for your reply Jennifer, unfortunately, still getting the same error.

0 0
replied on May 20, 2024 Show version history

Tried this approach and it appears to be working

 

https://answers.laserfiche.com/questions/157877/Formula-to-count-rows-in-a-table-or-to-check-if-a-row-exists


=IF(COUNTIF(MyTable.SomeColumn,"<> ")>1,INDEX(MyTable.SomeColumn,2),"")

SELECTED ANSWER
replied on May 20, 2024 Show version history

=SUMIF(MyTable.TheColumnToBeSummed, ">0", MyTable.TheColumnToBeSummed)

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.