I'm new to Calc, but I'm trying to create an inventory/order sheet. I want my "NEED" column to equal 0 when less then 0 (-1,-2, ect.)
My inventory is ascending A4:A126
PAR, ON_HAND, and NEED columns are in B,C,D.
Example:
B4 = 6 (PAR)
C4 = 8 (ON_HAND)
D4 = -2 (NEED)
What I have is =B4-C4 ... I don't know how to complete the formula to give me the result I'm looking for.
I need a formula to show 0 or blank if the D column equals a negative integer.
Thanks in advance.
[Solved] Need a formula to make all Negative integers to = 0
[Solved] Need a formula to make all Negative integers to = 0
Last edited by Bernhard on Sun May 15, 2011 4:21 pm, edited 1 time in total.
OpenOffice 3.1 on Windows Vista
- Hagar Delest
- Moderator
- Posts: 33693
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Need a formula to make all Negative integers to equal 0
Hi and welcome to the forum!
There are different ways to do it, the quickest IMHO is:
=MAX(0;B4-C4)
Please add '[Solved]' at the beginning of your first post title (edit button) if your issue has been fixed.
There are different ways to do it, the quickest IMHO is:
=MAX(0;B4-C4)
Please add '[Solved]' at the beginning of your first post title (edit button) if your issue has been fixed.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
Re: Need a formula to make all Negative integers to equal 0
You could use a formula like this:
=IF((B4-C4) > 0,B4-C4,0)
This gives you the positive value if B4 is greater then C4 otherwise you get zero.
=IF((B4-C4) > 0,B4-C4,0)
This gives you the positive value if B4 is greater then C4 otherwise you get zero.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
Gurkha Welfare Trust
Re: Need a formula to make all Negative integers to equal 0
Yet another way where you will see actual zero values and blanks for negatives.
To make sure zeros will be displayed check at Tools > Options > Calc > View and make sure Zero Values is checked.
Select column D, do Format > Cells > Number tab, with Number selected enter enter the following in the Format Code box:
#,##0.00;"";0
Positive;Negative;Zero formats can be done in this manner.
If you try TheGurkha's formula change the commas to semicolon. Commas are correct with LibO but you indicate your using OOo.3.1.
To make sure zeros will be displayed check at Tools > Options > Calc > View and make sure Zero Values is checked.
Select column D, do Format > Cells > Number tab, with Number selected enter enter the following in the Format Code box:
#,##0.00;"";0
Positive;Negative;Zero formats can be done in this manner.
If you try TheGurkha's formula change the commas to semicolon. Commas are correct with LibO but you indicate your using OOo.3.1.