Re: [libreoffice-users] Re: Integer part of a number

2012-10-15 Thread John Clegg
Indeed. Which is why your last answer is also wrong!

On 15 October 2012 15:08, Andreas Säger ville...@t-online.de wrote:

 Am 15.10.2012 10:45, Brian Barker wrote:
  At 10:49 15/10/2012 +0300, Pertti Rönnberg wrote:
  On 14.10.2012 12:20, Gilles SICHE wrote:
  could anyone tell me which formula I should use for the integer part
  of a cell to be shown in another cell, ...
 
  The answer could be:
  =IF(C31;0;INT(C3))
 
  You are overthinking the problem: if C3 is positive, that's no different
  from
  =INT(C3)
 
  Brian Barker
 
 

 Reportedly, negative numbers do exist.


 --
 For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
 Problems?
 http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
 Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
 List archive: http://listarchives.libreoffice.org/global/users/
 All messages sent to this list will be publicly archived and cannot be
 deleted



-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: Integer part of a number

2012-10-15 Thread Brian Barker

At 14:42 15/10/2012 +0200, Andreas Säger wrote:

Am 15.10.2012 09:49, Pertti Rönnberg wrote:
if value in cell c3 is /_less than_/ '1' then 
d3 shall be '0', else (-- if c3 is '1' or 
bigger then -- ) use the integer of value in c3)


=MIN(0;INT(C3))


This is getting sillier!  This formula does not 
match the definition above - and indeed for 
non-negative C3 is identically zero!  Try

=0
instead.

Brian Barker


--
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: Integer part of a number

2012-10-15 Thread Brian Barker

At 16:08 15/10/2012 +0200, Andreas Säger wrote:

Am 15.10.2012 10:45, Brian Barker wrote:

At 10:49 15/10/2012 +0300, Pertti Rönnberg wrote:

 On 14.10.2012 12:20, Gilles SICHE wrote:
could anyone tell me which formula I should 
use for the integer part of a cell to be shown in another cell, ...


 The answer could be:
 =IF(C31;0;INT(C3))


You are overthinking the problem: if C3 is positive, that's no different from
=INT(C3)


Reportedly, negative numbers do exist.


But not, it would seem, in the original 
questioner's election results.  Unless you know how to cast a negative vote ...


Brian Barker


--
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: Integer part of a number

2012-10-15 Thread James Knott

Andreas Säger wrote:

Am 15.10.2012 10:45, Brian Barker wrote:

At 10:49 15/10/2012 +0300, Pertti Rönnberg wrote:

On 14.10.2012 12:20, Gilles SICHE wrote:

could anyone tell me which formula I should use for the integer part
of a cell to be shown in another cell, ...

The answer could be:
=IF(C31;0;INT(C3))

You are overthinking the problem: if C3 is positive, that's no different
from
=INT(C3)

Brian Barker



Reportedly, negative numbers do exist.



ABS(INT(C3))

--
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: Integer part of a number

2012-10-15 Thread Brian Barker

At 10:34 15/10/2012 -0400, James Knott wrote:

Andreas Säger wrote:

Am 15.10.2012 10:45, Brian Barker wrote:

At 10:49 15/10/2012 +0300, Pertti Rönnberg wrote:

On 14.10.2012 12:20, Gilles SICHE wrote:
could anyone tell me which formula I should 
use for the integer part of a cell to be shown in another cell, ...


The answer could be:
=IF(C31;0;INT(C3))


You are overthinking the problem: if C3 is 
positive, that's no different from

=INT(C3)


Reportedly, negative numbers do exist.


ABS(INT(C3))


Now you are assuming (1) that negative election 
results are possible, and (2) that they should be 
given equal weight with positive ones.  Perhaps 
you can find me a bank where withdrawals increase 
my balance just as deposits do?


Brian Barker


--
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: Integer part of a number

2012-10-15 Thread Brian Barker

At 16:36 15/10/2012 +0200, Andreas Säger wrote:

Am 15.10.2012 16:20, Brian Barker wrote:

 At 14:42 15/10/2012 +0200, Andreas Säger wrote:

 Am 15.10.2012 09:49, Pertti Rönnberg wrote:
if value in cell c3 is /_less than_/ '1' 
then d3 shall be '0', else (-- if c3 is '1' 
or bigger then -- ) use the integer of value in c3)


=MIN(0;INT(C3))


This is getting sillier!  This formula does not 
match the definition above - and indeed for 
non-negative C3 is identically zero!  Try

=0
instead.


Sorry, should be:
=MAX(0;INT(C3))


Again, for positive C3, that is identical to
=INT(C3)
- which was suggested by someone a long way earlier in this thread!

Brian Barker


--
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: Integer part of a number

2012-10-15 Thread James Knott

Brian Barker wrote:

Now you are assuming (1) that negative election results are possible,


Well, with the way Romney's doing...  ;-)


I was just posting in reference to comment about negative numbers and 
not the original post.


--
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: Integer part of a number

2012-10-15 Thread Steve Edmonds


On 2012-10-16 04:11, Brian Barker wrote:

At 16:36 15/10/2012 +0200, Andreas Säger wrote:

Am 15.10.2012 16:20, Brian Barker wrote:

 At 14:42 15/10/2012 +0200, Andreas Säger wrote:

 Am 15.10.2012 09:49, Pertti Rönnberg wrote:
if value in cell c3 is /_less than_/ '1' then d3 shall be '0', 
else (-- if c3 is '1' or bigger then -- ) use the integer of value 
in c3)


=MIN(0;INT(C3))


This is getting sillier!  This formula does not match the definition 
above - and indeed for non-negative C3 is identically zero!  Try

=0
instead.


Sorry, should be:
=MAX(0;INT(C3))


Again, for positive C3, that is identical to
=INT(C3)
- which was suggested by someone a long way earlier in this thread!

Brian Barker



Were there negative voters, you could use =TRUNC(C3).
This has been an interesting discussion because I have learnt that 
INT(-1.1) is 2 and if I want the integer part of -1.1 I need to use TRUNC.
INT returns the next integer less than or equal to the value. TRUNC 
returns the integer part of the value (in the format I have shown).

steve


--
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Re: Integer part of a number

2012-10-15 Thread Brian Barker

At 11:56 15/10/2012 -0400, James Knott wrote:

Brian Barker wrote:

Now you are assuming (1) that negative election results are possible,


I was just posting in reference to comment about negative numbers 
and not the original post.


That makes your suggestion (of applying ABS() to the values) even 
more surprising!  If you get a negative value and you are surprised 
by it, you had better determine what has gone wrong - perhaps a 
mistake either in data entry or else in the algorithm used in your 
calculations.  If your deliberations lead you to replace the negative 
value by a positive one, it would be very naive to imagine that the 
equivalent positive value is necessarily any more appropriate than 
any other non-negative value.


If your bank manager reports that you are overdrawn, do you make a 
correcting deposit or do you merely offer the helpful suggestion that 
s/he should use correcting fluid to excise the negative sign from 
your balance?  If you believe there is a valuable mineral deposit ten 
metres under your back garden but you do not fancy digging down to 
it, do you simply build a ten-meter tower instead and expect to 
harvest the deposit up in the air?  If you have three metres of 
string available and need to use five metres of it, does that mean 
you will have two metres left over?


Brian Barker


--
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted