Time +/- calculation

Fester675

Board Regular
Joined
Sep 16, 2016
Messages
141
I am developing a flexi-working sheet for employees, and have run into a problem...

For any time input cells, I have used [h]:mm as the cell format. However I need to generate a running balance (either a flexi credit, or a flexi debit).
The sheet has 3 sections -

  1. Day; Date; Morning time in/out; Midday time in/out; Afternoon time in/out - works fine
  2. Worked (sum of actual hrs/min worked); Credit (any additional time credited); Total (total of worked + Credit) - works fine
  3. Standard working day (7:24); Debit (amount less than standard); Credit (amount more than standard); Running Balance - this is where it goes wrong - the first cell (Monday) should take the balance carried forward from a particular cell and either -/+ this figure dependant on whether the Debit or Credit cell is completed. If Running Balance is a (-) figure then it should populate in red font and if (+) figure then it should populate in green.

The main issue is I can't do a formula to +/- on the running balance, dependant if there is a credit or debit overall - or at least, not one that will return my answer in the same [h]:mm format.

Any help is greatly appreciated!
 
<o7,"",k7-o7)))
How can I format the box for 'balance brought forward' if the value is a negative (debit) balance of hours/mins?

Do you mean you to format it red when it's negative? Did you try..

<o7,"",k7-o7)))
Once you get your times displayed the way you want, you can try a custom number format of:

[hh]:mm;[Red][hh]:mm
</o7,"",k7-o7)))
</o7,"",k7-o7)))
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
It won't let me enter a negative time in the 'balance brought forward' cell e.g. -2:00

I thought you had resolved that by using the 1904 date system :confused:
 
Upvote 0
It seems that the 1904 system works fine for using a formula to generate a cell to be completed, but the balance brought forward is a manual entry and it won't take a negative "-2:00" is returned as an error. If I the do '-2:00 then the running balance returns ####

Confused.
 
Upvote 0
It seems that the 1904 system works fine for using a formula to generate a cell

Maybe use a formula then to enter your "manual" time:

i.e.

=-TIME(2,0,0)
 
Upvote 0
Really appreciate all your help on this!

I managed to get round it by entering -"2:00" and all calculations appear to work fine. Thank you again!!
 
Upvote 0

Forum statistics

Threads
1,215,593
Messages
6,125,715
Members
449,254
Latest member
Eva146

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