Need help in round up or down price to specific ending number

M

Ms. Latte

Can anyone help me? I doing the price, there is two processes, first I have
to calculate the USD to my country's currency then I have to round up or down
the price. I need the price end with 500, 700, or 900 without decimal.

The way to round the price is like this.

0-299 round down to 900 ex: 3250 round to 2900
300-599 round to 500 ex: 4365 round to 4500 if 5580 round to 5500
600-700 round to 700 ex: 8600 round to 8700
799-900 round to 900 ex: 4800 round to 4900
901-000 round to 900 ex: 3980 round to 3900

thank you in advance
 
J

Joel

You need to round the number down to the nearest 1000. Then look up get the
value between 0 to 999 and perform a lookup using the lowest number of your
range. The lookup value is then added/subtract to the rounddown value


=ROUNDDOWN(D4,-3)+LOOKUP(MOD(D4,1000),{0,300,600,799;-100,500,700,900})
 
M

Ms. Latte

Dear Joel,

This is exactly what I want. and it is very easy to apply. Thank you so
much. You are very great. : )
Many thanks
 

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