View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kevin Lyons Kevin Lyons is offline
external usenet poster
 
Posts: 12
Default Macro Ceiling & Floor Calculation Problem...

Hello,

The following macro calculations are not acting as I expect them to for a
select group of numbers:

fullRange = finishRange - startRange
actName = Application.Ceiling(fullRange / 3, 1)
diffName = (fullRange - actName) / 2
ceilName = Application.Ceiling(diffName, 1)
floorName = Application.Floor(diffName, 1)

Given fullRange = 2 then actName = 1, but diffName = 0, ceilName = 0, &
floorName = 0
Shouldn't diffName = .5, ceilName = 1, and floorName = 0?

Similarly, Given fullRange = 5 then actName = 2, but diffName = 2, ceilName
= 2, & floorName = 2
Shouldn't diffName = 1.5, ceilName = 2, and floorName = 1?

From 1 to 10, the other numbers appear to function correctly. There might
be even others where this doesn't work, but I haven't checked yet.

Thanks much for any help.

Kevin