Limit sumif total to set maximum

gogirlmp

New Member
Joined
Jul 25, 2013
Messages
19
I am calculating employees PTO hours each pay period, a starting balance, earned hours and requested time off. Some employees will request up to 14 days off within the pay period but the total subtracted needs to be limited to 80 hours.

My formula works in calculating a running PTO balance except for the cap on used hours. How to I add the limit the requested hours to 80.

D13=previous PTO balance, M2=starting PTO balance, G2:G27=the pay periods, H2:h27=the hours requested in each pay period and A14=the current pay period.

=D13+$M$2-SUMIF($G$2:$G$27,A14,$H$2:$H$27)

(A) (D) (G) (H)
Pay PeriodPayPeriod Start DatePTO Running TotalPTO Start DatePTO PP RequestedPTO hours usedPay Period StartCurrent PP PTO BalanceEarning Rate/hrs
52/18/2018442/18/2018582/18/2018599.241
63/4/2018372/24/2018516
73/18/2018233/4/201868
84/1/2018243/11/201868
94/15/2018-233/18/201878
104/29/2018-143/24/201878
115/13/2018-43/25/201878
125/27/201854/9/201888
136/10/201864/19/2018916
146/24/2018154/21/2018916
157/8/2018174/23/201898
167/22/2018-64/28/2018916
178/5/2018-856/10/2018138
188/19/2018-1007/14/2018158
199/2/2018-907/27/2018168
209/16/2018-817/28/20181616
219/30/2018-727/30/2018168
2210/14/2018-638/9/20181716
2310/28/2018-618/11/20181716
2411/11/2018-608/13/20181740
2511/25/2018-518/18/20181716
2612/9/2018-428/20/2018188
112/23/2018-328/21/2018188

<tbody>
</tbody>



Thank you in advance for your assistance
 
Last edited:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi there.
You could code it like this: =D13+$M$2-IF(SUMIF($G$2:$G$27,A14,$H$2:$H$27)>=80,80,SUMIF($G$2:$G$27,A14,$H$2:$H$27))
but I prefer arthur's answer!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,559
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top