Deuterophobia
New Member
- Joined
- Sep 23, 2024
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Hello. I know that Excel cannot deal with negative hh:mm without serious workarounds. I am trying to create a sheet where an employee's time over or under the required amount per week can be entered, and then the difference calculated automatically.
At present, the only way I am currently aware of entering negative hh:mm is to prefix it with an apostrophe (or format as text) and this renders the cell contents non-mathematical. I am wondering if it is worthwhile attempting to create a formula, presumably with a large number of nested IF & using AND or if this is too ambitious. I suspect I could write a macro in VBA to do this, but a pure spreadsheet with formulas/functions would be preferable.
I am familiar with using LEFT to test if the two cells are prefixed with a minus sign, and using MID to obtain the ABS, and then to convert to a decimal for the calculation in an extra column. It's the level of nested IF &c which is causing some alarm.
The calculation would have to cater for both times being positive; one negative and the other positive; one positive and the other negative; both negative. If both negative, it would have to consider if the first number is larger or smaller than the second number.
I'm not necessarily looking for a complete answer; just some hints, including DON'T BOTHER if this is a futile endeavour!
Many thanks for your time.
At present, the only way I am currently aware of entering negative hh:mm is to prefix it with an apostrophe (or format as text) and this renders the cell contents non-mathematical. I am wondering if it is worthwhile attempting to create a formula, presumably with a large number of nested IF & using AND or if this is too ambitious. I suspect I could write a macro in VBA to do this, but a pure spreadsheet with formulas/functions would be preferable.
I am familiar with using LEFT to test if the two cells are prefixed with a minus sign, and using MID to obtain the ABS, and then to convert to a decimal for the calculation in an extra column. It's the level of nested IF &c which is causing some alarm.
The calculation would have to cater for both times being positive; one negative and the other positive; one positive and the other negative; both negative. If both negative, it would have to consider if the first number is larger or smaller than the second number.
I'm not necessarily looking for a complete answer; just some hints, including DON'T BOTHER if this is a futile endeavour!
Many thanks for your time.