Skip to main content
Participant
September 8, 2021
Answered

Calculating Sum of Multiple Fields & Ignoring Empty Fields

  • September 8, 2021
  • 1 reply
  • 1069 views

Hi, I'm creating a table which calculates the individual PRODUCT "Quantity" and "Price" for up to 10 items. Then the table has a "Total" (SUM of all PRODUCTS).

 

The issue I'm having is that some people will not use all of the "Quantity" and "Price" fields, and when they are left empty, the "Total" does not calculate unless all "Quantity" and "Price" are filled.

 

Right now I have a simple set up for calculating:

 

Field QP1 = Field Q1*Field P1 - this is what I use to calculate the Total of quantity and price for one item. This is continued from field QP1 to QP10

Field Total Value of Transfer = QP1+QP2+QP3+QP4+QP5+QP6+QP7+QP8+QP9+QP10 - this is where things get broken in the calculations I think, I just can't wrap my head around how to get these to work when some "QP" values are empty.

 

I'm not sure if this makes sense, but it would be helpful if someone has any idea of what I'm talking about.

This topic has been closed for replies.
Correct answer try67

The fields calculation order is incorrect. You have to move the Total field to the end of the list for it to work correctly. The rest seems fine to me.

1 reply

try67
Community Expert
Community Expert
September 8, 2021

This should not be an issue. When the field is empty the SUM function treats it as zero. Is that not the case in your file? If so, then something is wrong there. What is the result, then, of this calculation? Can you share the actual file with us?

DK2IncAuthor
Participant
September 8, 2021

Click here for the file - I didn't think it would be a problem either. It's a fairly simple calculation (at least it seems so)

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
September 8, 2021

The fields calculation order is incorrect. You have to move the Total field to the end of the list for it to work correctly. The rest seems fine to me.