I need to Round Cells up to next .99$

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have all kinds of different prices for items that i need to make all of
them no matter what the margin i give it it turns that cell to the next .99$
never rounding down only up even if its 15.01$ i need it to go to 15.99$
thanks for help
 
=ROUNDUP(A1,0)-0.01

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

|i have all kinds of different prices for items that i need to make all of
| them no matter what the margin i give it it turns that cell to the next .99$
| never rounding down only up even if its 15.01$ i need it to go to 15.99$
| thanks for help
|
 
You don't actually need to use VB to do this. You can simply use:
=CEILING(A1+0.01,1)-0.01
**I've assumed that you want $16-> 16.99 and 16.99 to stay at 16.99.

However, if you want to use VB, just do basically the same thing. Do
something like this:
Sub test_round()
For i = 1 To 4
initial = Cells(i, 1).Value
newValue = Application.WorksheetFunction.Ceiling(initial +
0.01, 1) - 0.01
Cells(i, 2).Value = newValue
Next
End Sub
Here I've assumed the initail values are in column A, and the resulting
values will be placed in column B. I've also assumed there are only 4
rows of numbers to be changed, but without knowing more about the data
structure, this is the best I can do.
 

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

Back
Top