Need help with rounding

S

SUSAN

I have a rounding question. i need to do the following:

Round:


$#.00 - $#.09 round up to $#.09

$#.10 - $#.49 round up to $#.49

$#.50 - $#.99 round up to $#.99

Examples: 11.05 would round to 11.09
25.36 would round to 25.49
5.60 would round to 5.99

Is there a way to do this?

Thank you!
 
P

Per Jessen

Hi Susan

With the number in A1 try this formula in B1:

=IF(A1-INT(A1)<=0.09,INT(A1)+0.09,IF(A1-INT(A1)<=0.49,INT(A1)+0.49,INT(A1)+0.99))

Regards,

Per
 
B

Brad

Couple of way to do this
=if(mod(a1,1)<=.09,int(a1)+.09,if (mod(a1,1)<=.49,int(a1)+.49,int(a1)+.99))
would be the way I'd do it.
 
S

SUSAN

Thank you so much, exactly what we needed!

David Biddulph said:
=IF(MOD(A1,1)<=0.09,INT(A1)+0.09,IF(MOD(A1,1)<=0.49,INT(A1)+0.49,INT(A1)+0.99))

Note that you didn't specify what happens to inputs between 0.09 and .10,
between .49 and .50, and between .99 and .00.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top