Simple clear advice in plain English

How can I ensure prices stay the same if I update a spreadsheet?

There is no simple solution if using Excel's VLOOKUP. We suggest that the best way of protecting your prices would be to have a separate lookup table for them

Paste special screenshot
Use the Paste Special function to remove your old formula

Q I am a treasurer of a club and use an Excel spreadsheet to record sales and values of items sold. I set up a separate worksheet containing a price table and then used the VLOOKUP function to obtain the cost of each item.

This was working well until I changed the price of an item, which caused the sale value to change retrospectively for all transactions involving that item. How can I cure this problem?
Brian King

A If you want to solve this in an automated fashion then you are out of luck – at least, if you were hoping for an easy answer, that is.

The trouble is that VLOOKUP, in common with many of Excel’s built-in functions, can only take automation so far. Specifically, VLOOKUP references a particular cell and returns the value it contains.

If you later alter the value of the referenced cell – a price in this case – then the change will affect all the other cells that continue to use the same VLOOKUP-laden formula to check the price.

Essentially, you have a couple of options. The first is to remove the cost-calculating formula from older transactions before making price changes, meaning that the values in cells will remain fixed. The easiest way to do this en masse is to first select and copy the affected cells (left-click, drag to select, right-click and choose Copy).

Then, leaving the same cells selected, right-click again and choose Paste Special. When the Paste Special dialogue box appears, click to select the Values radio button and click OK.

The second option would be to create a new, separate lookup table each time the price list needs to change. This could be a sensible strategy anyway for accounting purposes, as it would allow you to track historical price movements.

Unless the lookup table is large and complex, it’s hardly a big effort. To do this, click and drag to select the existing lookup table, then right-click the selection and choose Copy.

Now right-click in a blank cell to the right or below (as per your preference) and choose Paste. Update the prices as necessary and then amend the VLOOKUP-bearing formula in the main worksheet to reference the cells containing the price in this new lookup table.

Finally, if you are intent on maintaining a single lookup table but would like to automate the process of fixing the prices in cells that represent older transactions, then we can envisage that it would be possible to achieve the task by writing a Visual Basic script – but that is well beyond the scope of No Problem.

Reader Comments

uh.. store DATA in a DATABASE and use Excel for a doorstop!

uh.. store DATA in a DATABASE.. excel isn't designed for storing historical data over time.

Posted by aaron kempf, 02 Jun 2011

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Hands on: Import and export data from Excel spreadsheets

Four options for dealing with the ins and outs of the software

How to add images to Excel spreadsheets

Put pictures in a comment box

Using Wizard to create a form

Create a good Base for your data

Databases may sound very dreary but they are behind almost everything we do. We explain how to go about starting one of your own using Libre Office Base

Question & Answer

Q.Why are some of the keys on my keyboard doing strange...

> Read the answer

Q.Is my phone’s Bluetooth any use?

> Read the answer

Q.Can I switch boot drives so that I can work on older...

> Read the answer

Best deals on the web

img

WACOM Bamboo Pen & Touch Graphics Tablet

£47.97- Buy it now

img

LIVESCRIBE Echo Smartpen - 2GB, Black

£69.99- Buy it now

img

Dell Keyboard : Danish (Qwerty) Dell KB212-B Quietkey USB Keyboard Black (Kit)

£21.59- Buy it now

Latest issue & subscription deals

Poll

Are you concerned about viruses that target mobile phones?

Jargon Buster

Computing terms explained in plain English

Bios

Basic Input Output System. Essential software built into every PC that connects the vital components....

Great shopping deals from Computeractive