View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis[_3_] Dana DeLouis[_3_] is offline
external usenet poster
 
Posts: 690
Default working with decimal remainder

if i have a number in a cell (say 2.456)
basically I am working with dollars and cents


Hi. If I am not mistaken, the other excellent ideas didn't round a number
like 5.00 down to 4.99.
Here is just one of a few ideas. If you have in A1 a number like 2.456,
then in B1, I would Round this to 2 decimal places with:
=ROUND(A1,2)

Then perhaps in C1, a formula like.
=CEILING(B1+0.01,0.25)+0.24*(MOD(B1,1)=0.5)-0.25*(MOD(B1,1)=0.75)-0.26*(MOD(B1,1)=0)

A helper cell to hold MOD(A1,1) might be helpful too.
HTH :)
--
Dana DeLouis
Win XP & Office 2003


"Gixxer_J_97" wrote in message
...
hi all,

if i have a number in a cell (say 2.456) and i want to work with ONLY the
0.456 - is there a function that will let me do that

i can write a function in vba to take care of everything - i would prefery
to stay with worksheet functions as much as possible.

basically i am working with dollars and cents - and i want to create a
conditional function that will adjust the prices according to
$X.00 - $(X-1).99
$X.01 - $X.24 - $X.25
$X.25 - $X.49 - $X.50
$X.50 - $X.99 - $X.99

thanks for your help!

J