Formula to add and then multiply only if result of sum is a positive number?

nene0713

New Member
Joined
Dec 5, 2016
Messages
1
I'm working with a time sheet where I need to calculate and track actual hours worked, comp hours earned, comp hours accumulated, and comp hours used. I have formulas to do this, but we are going to a new system where comp hours worked are earned at a rate of 1.5. I need to add up hours worked for the current week, multiply anything over 40 by 1.5, and add it to the "comp hours bank". But if a person uses comp hours instead of earns them, those just need to be subtracted out of the bank.

Is there a way to do this formula all in the same cell or do I need to create a reference cell?

I have a screenshot of my worksheet but I can't figure out how to insert it in this message. I will try and explain below. Where the text is red - those are the cells where I want a formula that will take current hours worked, subtract 40, multiply by 1.5 if it's a positive number, then add to or subtract from whatever was already in the bank.

Example:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Comp Hours Bank (carried over from previous month)[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Week 1 hours worked[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD]New comp bank total (week 1 hours - 40, multiplied by 1.5, added to 3 hours already in bank)[/TD]
[TD]18[/TD]
[/TR]
[TR]
[TD]Week 2 hours worked[/TD]
[TD]32[/TD]
[/TR]
[TR]
[TD]New comp bank total (8 hours comp time used, subtracted from bank)[/TD]
[TD]10[/TD]
[/TR]
</tbody>[/TABLE]


Thank you for any help!!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
i think this would work.
Assume RowsCells A1:A5
In A3
Code:
=If(A2>40,A1+((A2-40)*1.5),A1+(A2-40))
In A5
Code:
=If(A4>40,A3+((A4-40)*1.5),A3+(A4-40))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,270
Messages
6,171,103
Members
452,379
Latest member
IainTru

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