Want to Update the Price field and format digits after decimal point in xls.

I have a "our_price" Column field that contains values like : 50.22, 8.78, 68.19, etc.

I want to do 2 things:

1. Raise all prices in the "our_price" field by 18%

2. I want the last 2 digits after the decimal point to be rounded like this :

If :  .01 to .29  =  .29

If :  .30 to .49  =  .49

If :  .50 to .99  =  .95

So if  the price is "29.14", it would be "29.29", . . . "18.78" would be "18.99", etc.

Can I combine these 2 queries at once? Or should I run 2 separate queries?

I'm using Excel Starter 2010,  and a :  Excel 97 - 2003 Workbook ( *.xls)

I'm not good at Exel at all, so the more detailed instructions the better.

LVL 16
Who is Participating?
FlysterConnect With a Mentor Commented:
This will raise your value by 18% and round it as listed above. Change "A1" to the cell containing the price.


MikeMCSDAuthor Commented:
thanks Flyster, . .  How do I "run" it?
You just paste it into any cell. It will automatically "run" when you enter a value in A1, or whatever cell you want.
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

MikeMCSDAuthor Commented:
What I have is a sheet that already has 500 rows,
and each column already has the price (like 2.88, 55.44, etc.) in it.

I pasted it in a few columns, and it displays : #NAME?
What do I do in this situation?

Say your prices are in A1-A500. In B1 paste the formula above. Now copy that cell, B1, and paste it down to B500. Once pasted, the formula will adjust to the corresponding cells. Just make sure you modify the original formula to reflect the cell with your price, if it isn't already A1.
Hopefully the above will work for you. I have to leave for a bit. Will check back later.
Patrick MatthewsCommented:
Another way to do this, using VLOOKUP:


Using that big array constant as the lookup table can be confusing, so I usually recommend setting up a lookup table on another worksheet.  So, if you have a worksheet named Lookup, you could enter these in A1:B5...

Start Decimal      Round To
0.00       0.00
0.01       0.29
0.30       0.49
0.50       0.95

My formula above then becomes:


If you are using Excel 2007/2010 and set up that lookup range as a Table, or in any version if you set it up as a named range:


For more about VLOOKUP, please see:

MikeMCSDAuthor Commented:
thanks Matt, but I don't understand anything about Excel or formulas, and don't really know how to use that.

>>  In B1 paste the formula above. Now copy that cell, B1, and paste it down to B500.  

There is a field in B1 already. The next empty field is CY1.
I tried selecting that column range and pasting the formula but it give a message saying "the clipboard is larger . . ".

Patrick MatthewsCommented:
OK, let's try again :)

What is the first cell with an original price in it, and what is the first available, unpopulated column?

Based on your comment above, it looks like the first available column is CY.

If the first available price is in A1, then put this in CY1:


If the first available price is in A2, then put this in CY2:


If the first available price is in W2, then put this in CY2:


You get the idea :)

Once you do that, select the cell where you entered the formula, and hit Ctrl+C to copy.  Now select the range you would need to copy that formula to, and hit Enter.
MikeMCSDAuthor Commented:
thanks Matt, . .  that worked but put the new values into the CY column.
I need the original prices that are in E2 - E500 changed. They are still displaying the original value.


Patrick MatthewsConnect With a Mentor Commented:
OK, now just select the cells in CY with that formula, and hit Ctrl+C to copy.

Select E2, right click, and select Paste Special from the popup.  Use the Paste Special dialog to select Values, and that will copy over the originals.

Then, just select Column CY and hit delete to clear the formulas.
MikeMCSDAuthor Commented:
thanks for the help guys
I'm glad it worked out for you. Thanks.
All Courses

From novice to tech pro — start learning today.