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.

Limit value sum formula

I am attempting to make a time sheet that calculate hours work and have the ability to separate the sum of the hours worked into two categories. I receive regular pay up to 43 in a given work week. Any hours over 43 are overtime hours. I type in my start and stop time for the work day and have a duration subtotal in the adjacent cell. I want to have two cells, the first displaying regular hours worked that sum all the duration hours but would like it to have a maximum displayed value of 43 if the hours worked equal or would exceed 43. The second cell shows the hours achieved over the 43 hour threshold, by calculating all the duration hours then minus 43 and it displays those hours above 43. I have attempted a MAX formula, but the value is constantly displaying value greater than 43 rather than just displaying 43 if the hours exceed it.

MacBook Pro 13″, macOS 11.3

Posted on Apr 30, 2021 1:49 PM

Reply
Question marked as Top-ranking reply

Posted on Apr 30, 2021 3:07 PM

Here are two formulas that should do the job.


For the example, I've placed the "Total Hours" values in column E to show the results for the two formulas with several different totals. Each row is a separate example of the calculations done for the weekly total shown in that row.


Formulas shown below the table are from cells F2 and G2 respectively.

In use you would need a cell (D2 in the examples) containing the sum of the daily hours, and one copy of each of the formulas illustrated above, with the cell reference to the cell containing the weekly total hours on your table replacing D2 in the first example above OR with a reference to the range of cells containing the daily hours replacing D2 in the second example.


F2: MIN(D2,"43h")

G2: MAX("0h",SUM((D2)−"43h"))


Regards,

Barry


PS: You may need to replace the values in quotes with DURATION(0) and DURATION(,,43) if you get an "expects a duration" error message.

Similar questions

5 replies
Question marked as Top-ranking reply

Apr 30, 2021 3:07 PM in response to darin264

Here are two formulas that should do the job.


For the example, I've placed the "Total Hours" values in column E to show the results for the two formulas with several different totals. Each row is a separate example of the calculations done for the weekly total shown in that row.


Formulas shown below the table are from cells F2 and G2 respectively.

In use you would need a cell (D2 in the examples) containing the sum of the daily hours, and one copy of each of the formulas illustrated above, with the cell reference to the cell containing the weekly total hours on your table replacing D2 in the first example above OR with a reference to the range of cells containing the daily hours replacing D2 in the second example.


F2: MIN(D2,"43h")

G2: MAX("0h",SUM((D2)−"43h"))


Regards,

Barry


PS: You may need to replace the values in quotes with DURATION(0) and DURATION(,,43) if you get an "expects a duration" error message.

Apr 30, 2021 6:00 PM in response to darin264

I'm sorry, but I'm a total newb to formulas--especially with Numbers. I'm attaching two screen shots of what I'm facing. The first is the total number of work hours and includes the formula I have for it. In the regular work hours, I only want to have a max number of up to 43.

The second screen shot shows my overtime formula which only shows any hours over the 43 hours mark.

Apr 30, 2021 9:56 PM in response to darin264

Hi Darin.


This formula, intended to return the "regular' hours should be returning the minimum of the two values, one supplied and the other calculated,not the maximum. As written, it will return 43 for any number of hours worked up to and including 43 hours, and the actual number of hours worked for any SUM greater than 43.


Change MAX to MIN to return the expected value.


One other change in the formula:

The syntax for SUM is SUM(value1,value2,…)

Your content for that function is value1+value2…

value1+value2… is an arithmetic sentence which returns a single value. making your SUM statement essentially SUM(value 1).


Either remove SUM( and ) from the formula, or replace the + signs with commas,


My recommendation would be to keep SUM(…) and separate the individual cell references with ,


Your formula would then become:

MIN(43,SUM(C4,C6,E4,E6,G4,G6,I4,I6,K4,K6,M4,M6,O4,O6)


Regarding the second formula:

This one should return the correct value as written. For consistency, I would write it and the first formula using the same format for adding the individual hours worked by either changing this one to follow the SUM() syntax or by removing SUM() from the first and using the addition format used in this one.


An alternative, which would reduce the calculation load on the document would be to sum the total working hours in one cell, then use a reference to that cell in place of the SUM or addition sentence in these two formulas.


Regards,

Barry

May 1, 2021 6:26 PM in response to darin264

Hi Darin,


You are welcome.

Thank you for the green checkmark.


And don't worry about being a 'total newb.' There's no shame in that, and we've all been there at some time!


I appreciate the clarity of both your topic statement (title0 and your question. Made it much easier to answer than some of the others. :-)


Regards,

Barry


Limit value sum formula

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