View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.newusers
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default More function than FLOOR() !

On second thought....

On Aug 4, 11:05 pm, joeu2004 wrote:
And while we're solving problems that the OP never asked about, any
one of those solutions can be further contorted to handle negative as
well as positive numbers. For example,
=sign(A1)*floor(abs(A1)-1,10)


Note that that has the same restriction as my original solution,
namely: abs(A1) = 1. But I don't like discontinuities when we talk
about problems involving negative as well as positive values. So the
following might be better:

=sign(A1)*floor(max(0,abs(A1)-1),10)

The same idea could be applied to the OP's problem, if the OP does not
like the restriction of A1 = 1, to wit:

=floor(max(0,A1-1),10)

I just wanted to KISS for the OP, especially noting that this is a
"newusers" group (although that often means little), as long as the
suggestion meets the OP's needs as I interpret them.



On Aug 4, 11:05*pm, joeu2004 wrote:
On Aug 4, 7:17*pm, Ron Rosenfeld wrote:

I guess I would have "ass"-umed, from the way the
question was posed, than values over 10 should convert
to 10.


Hmm, so you think that the OP chose FLOOR, a function that rounds
down, because the OP intended to round up. ;-)

Oh well, it's really not difficult to offer a constructive
improvement.

To do exactly what the OP asked for:

=floor(A1-1, 10)

To do what Ron wants, I think, as well as what the OP asked for:

=floor(roundup(A1,0)-1, 10)

To do the only other contorted interpretation that I can imagine, as
well as what the OP asked for:

=floor(round(A1,0)-1, 10)

And while we're solving problems that the OP never asked about, any
one of those solutions can be further contorted to handle negative as
well as positive numbers. *For example,

=sign(A1)*floor(abs(A1)-1,10)