View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default Math formula help

Robert Crandal wrote:

Here is a sampling of data that I want to
represent with a math formula:

X Y
-- --
0.0 1
0.38 1
0.88 1
1.0 1
1.01 2
1.22 2
1.99 2
2.0 2
2.10 3
2.77 3
3.0 3

etc.. etc..

So, for example, if X equals 1.22, then Y
should return 2, etc, as seen above.

I thought I could easily represent the above
data with a simple math formula, but it is
more difficult than I thought.

Can anyone think of a simple math formula
for this? Do I need to use the RoundUp function?

I prefer a simple math formula that does not use
if-else logic or the less-than or greater-than sybols,
if possible. Let me know if you have any ideas.


With the exception of 0.0, it looks like you're just rounding up to the next
integer. If you're willing to accept a single IF to catch the zero, this
works:

=IF(A1=0,1,CEILING(A1,1))

(If you're not *just* rounding up, then this won't work.)

--
Ambushes aren't part of your typical forest.