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:
Comp Hours Bank (carried over from previous month)3
Week 1 hours worked50
New comp bank total (week 1 hours - 40, multiplied by 1.5, added to 3 hours already in bank)18
Week 2 hours worked32
New comp bank total (8 hours comp time used, subtracted from bank)10

<tbody>
</tbody>


Thank you for any help!!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
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,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

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