Calculations & tables in Pages

Hello Community!


1. In pages I have created several tables with calculations (sum) of prices and discount at the end . In the last table I just want to add the SUM of each above table but the calculation is wrong see image below..





2. Also when I delete an entire table the "last" SUM table gives an error since it can't find the "deleted table". Is there any way to "ignore" the deleted table and sum the rest..



Thank you in advance




Yorgos’s MacBook Pro 15"

Posted on Mar 3, 2020 1:59 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 3, 2020 3:40 AM

The SUM function is defined using comma separators, not semi-colons as you have shown.


You would have to wrap each element of the SUM function with an IFERROR, so that when a reference (e.g. table) is removed (e.g. #REF!), a 0 is substituted for that error in the SUM arguments.


So here, in a fourth table, I am summing a single cell from the first three tables. I have only encapsulated table 1's reference in an IFERROR function as an example, but all table references would receive this treatment to be thorough. The IFERROR function detects that Table 1 is present, so its value is provided to the SUM function.



and here, I have removed Table 1, and with the following formula changed, showing that it detected Table 1 is missing and causes a #REF! error. A zero is then provided to the SUM function in place of the missing Table 1 data, and a final total of Tables 2 and 3 is shown for the cell hosting this formula.


12 replies
Question marked as Top-ranking reply

Mar 3, 2020 3:40 AM in response to Yorgos_87

The SUM function is defined using comma separators, not semi-colons as you have shown.


You would have to wrap each element of the SUM function with an IFERROR, so that when a reference (e.g. table) is removed (e.g. #REF!), a 0 is substituted for that error in the SUM arguments.


So here, in a fourth table, I am summing a single cell from the first three tables. I have only encapsulated table 1's reference in an IFERROR function as an example, but all table references would receive this treatment to be thorough. The IFERROR function detects that Table 1 is present, so its value is provided to the SUM function.



and here, I have removed Table 1, and with the following formula changed, showing that it detected Table 1 is missing and causes a #REF! error. A zero is then provided to the SUM function in place of the missing Table 1 data, and a final total of Tables 2 and 3 is shown for the cell hosting this formula.


Mar 4, 2020 1:23 AM in response to Yorgos_87

Hi Yioryos,


You are getting strange results because you have an error in the calculation of the discounted amount.



For simplicity, suppose the amount in C5 is 100.


Here's what your formula tells Numbers to do:


Get the value in C5 (100), multiply that value by the percentage in B6 (10% or 0.10), then subtract the amount in C5 (100) from the result of the multiplication.


(100*0.10)-100

solving the multiplication:

(10)-100

solving the subtraction:

10-100 = -90


Your formula should read:


C5 - (C5*B6)


Because the order of operations rules have multiplication and division completed before addition and subtraction, the parentheses wrapping C5*B6 are not necessary, and can be removed:


C5-C5*B6



Regards,

Barry


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Calculations & tables in Pages

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.