Ask Your Question
1

Calc formula problem

asked 2012-08-16 17:03:06 +0200

SirZalen gravatar image SirZalen
11 1

I have a simple sum formula that sometimes will be a negative. How do I get it to round up to 0 instead ?

delete close flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
0

answered 2012-08-16 17:36:06 +0200

tohuwawohu gravatar image tohuwawohu flag of Germany
1812 13 40

Straightforward solution - just use the IF function. Assuming A1:A10 are the summands:

=IF(SUM(A1:A10) < 0;0;SUM(A1:A10))

If your calc settings require commata as argument separators, use:

=IF(SUM(A1:A10) < 0,0,SUM(A1:A10))

link delete flag offensive edit

Comments

3

Another variant of same formula =MAX(SUM(A1:A10);0)

JohnSUN ( 2012-08-16 21:25:08 +0200 )edit

@JohnSUN: nice and elegant - worth an answer on its own!

tohuwawohu ( 2012-08-16 21:38:07 +0200 )edit
0

answered 2012-08-16 21:11:06 +0200

SirZalen gravatar image SirZalen
11 1

Thank you very much. This was perfect.

link delete flag offensive edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-08-16 17:03:06 +0200

Seen: 157 times

Last updated: Aug 16 '12