You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to I calculate the sum of a column if the value corresponds with a string and then add another value?

So here on the second table I have a total for SA, the function is not complete. I need it to add the tips made when the tips are from SA position (which I accomplished) but then I also need it to add my base hourly pay. So $80 + $6.55/hr for the hours I worked as SA.

Posted on Nov 24, 2020 3:55 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 25, 2020 12:40 PM

OK. Here's an example using a revised pair of tables.



Daily is a data table, on which some calculations are done.


The formula show below the table is in cell G2, and filled down to the end of column G. When entering the formula, use the asterisk ( * ) where it shows the multiplication sign. Numbers will immediately change that to the multiplication sign.


Cell F2 Contains this formula: E2÷D2


Filled down to the end of the column.


The result is displayed in the cell containing the formula, but is not used in the calculations in column G.

These results are used in the Average, Low nd High calculations in the second table.


The second table, which I've named Summary, uses the formulas listed below the table to calculate the results shown:


H2: SUMIF(Daily::B,A2,Daily::G)


A2: Entered values (position names) must match those in Daily.

B2: AVERAGEIF(Daily::B,A2,Daily::E)

C2, D2,

E2 :AVERAGEIF(Daily::B,A2,Daily::F)

F2, G2 — See below



Fill these formula down to Row 3 after you have made at least one set of entries for Server on the Daily table. The AVERAGEIF formulas will retrun a division by zero error if there are no entries to average.


The empty cells in row 2 will use MAXIF and MINIF (or MAXIFS and MINIFS) functions, which are not supported in my earlier version of Numbers. See the examples in Badunit's post above.


Regards,

Barry

6 replies
Question marked as Top-ranking reply

Nov 25, 2020 12:40 PM in response to fomy123

OK. Here's an example using a revised pair of tables.



Daily is a data table, on which some calculations are done.


The formula show below the table is in cell G2, and filled down to the end of column G. When entering the formula, use the asterisk ( * ) where it shows the multiplication sign. Numbers will immediately change that to the multiplication sign.


Cell F2 Contains this formula: E2÷D2


Filled down to the end of the column.


The result is displayed in the cell containing the formula, but is not used in the calculations in column G.

These results are used in the Average, Low nd High calculations in the second table.


The second table, which I've named Summary, uses the formulas listed below the table to calculate the results shown:


H2: SUMIF(Daily::B,A2,Daily::G)


A2: Entered values (position names) must match those in Daily.

B2: AVERAGEIF(Daily::B,A2,Daily::E)

C2, D2,

E2 :AVERAGEIF(Daily::B,A2,Daily::F)

F2, G2 — See below



Fill these formula down to Row 3 after you have made at least one set of entries for Server on the Daily table. The AVERAGEIF formulas will retrun a division by zero error if there are no entries to average.


The empty cells in row 2 will use MAXIF and MINIF (or MAXIFS and MINIFS) functions, which are not supported in my earlier version of Numbers. See the examples in Badunit's post above.


Regards,

Barry

Nov 24, 2020 6:17 PM in response to fomy123

HI fomy123,


I'm not getting a clear picture of your calculations.


The $80.00 is the total of the three tips amounts on the first table. What is the formula you used to return that total?


There are wage amounts listed in the first table for the three dates with data. You mention an hourly rate, but the amounts listed and the hours worked on each day to not match the reported rate. On the first two dates you worked the same number of hours (5, but show different amounts in the Wage column for each of those days.


How are thise wage amounts calculated?

Are they the amounts of your "base hourly pay", or something else?


Will a range of dates enter into the calulations, or os the table to show the results for ALL recorded dates in the first table?


Regards,

Barry






Nov 24, 2020 6:33 PM in response to Barry

Looks like I missed the actual question at the bottom of the screenshots.


If I understand what you asked, disregarding the wage values in the table that don't seem to match the question, you need to SUMIF the hours for SA and multiply that total by $6.55. That part of the formula for the total would be


6.55*SUMIF(Tips Made::B,"SA",Tips Made:C)


In your table this would be 6.55*(5+5+4.5) = 94.975 (or 94.98 when rounded)


How to I calculate the sum of a column if the value corresponds with a string and then add another value?

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