[Solved] Subtract, but prevent negative result
-
manicmailman
- Posts: 2
- Joined: Fri Nov 08, 2024 12:40 am
[Solved] Subtract, but prevent negative result
Novice LibreOffice user here looking for some help on how to do conditional subtraction. I have a spreadsheet of workhours for a week, and I want to make a formula that will take the raw workhours and subtract 11.50 to find total hours worked past the hourly limit of 11.50, but will ignore the function (or else zero it out) if they worked less than 11.50. Any help is appreciated!
Last edited by MrProgrammer on Thu Nov 21, 2024 7:34 am, edited 2 times in total.
Reason: Edited topic's subject
Reason: Edited topic's subject
OpenOffice 24.2.3.2, Windows 11 Pro x64
Re: Raw Subtract If and conditional subtraction
If your raw hours are in B2, this formula should work.
You will get zero if B2 is less than 11.5.
Code: Select all
=MAX(0;B2 - 11.5)OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
-
manicmailman
- Posts: 2
- Joined: Fri Nov 08, 2024 12:40 am
Re: Raw Subtract If and conditional subtraction
Works like a charm! Thanks a lot!
OpenOffice 24.2.3.2, Windows 11 Pro x64
Re: Raw Subtract If and conditional subtraction
Or you could use IF():
Code: Select all
=IF(B2 < 11.5; 0; B2 - 11.5)Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.