Microsoft Excel Help: Avoid #REF! Errors When Deleting Columns
RSS
 View all Hubs
See what's in...

Microsoft Excel: Avoid #REF! Errors When Deleting Columns

Article by Mr Excel (11,376 pts )
Published on Jun 24, 2008
Problem: Excel is great at computing results. Sometimes, you only need to keep the results of a formula and you want to erase the columns that the calculation was based upon. If you delete a column used in the formula, the formula result changes to #REF!. How can you prevent the #REF! Error?
163 views

See all Microsoft Excel tips

Here is a true story. When I was working at my last day job, someone in our marketing department was given a list of leads from a trade show. The Excel file had the area codes in one column and the telephone numbers in another column. There were several thousand leads. Someone in Marketing was retyping all of the telephone numbers in order to get the area code and phone number in one cell, as shown in Fig. 288.

As shown in Fig. 289, I showed this person how to use a formula to quickly convert all five thousand telephone numbers

to the format that she wanted. I started to walk away, whistling a little tune because I had just saved someone a whole lot of typing. I had just about reached the door of the marketing department when I heard a scream. Since column J contained the information that she needed, she had deleted columns H and I. However, since column J was still a live formula, Excel no longer knew how to calculate the results in J. And, because cells referenced in the formula had been deleted, all of the telephone numbers that were in column J now showed the #REF! error, as shown in Fig. 290.

Strategy: Immediately hit Ctrl+Z to undo the delete and get the source columns back. Next, you will copy the formulas and use Paste Special to paste the cells as values instead of formulas.

1) With the cell pointer in cell J2, hold down the Shift key while you tap the End key and then the Down Arrow key. This will select the entire contiguous range of cells in column J.

2) From the menu, select Edit – Copy to copy the cells to the clipboard.

3) Without changing the selection, select Edit – Paste Special from the menu. In the Paste Special dialog box, choose the Values option, as shown in Fig. 291. Choose OK.

Result: The telephone numbers in column J are converted from formulas to the results of those formulas, as shown in Fig. 292.

You can now safely delete columns H and I and the telephone numbers in column J will not change to #REF! errors.

Summary: Using the Paste Special Values technique is essential to becoming proficient in Excel. It will convert a range of formulas to the current value of the formula. You can then safely delete the source columns.

Commands Discussed: Edit – Copy; Edit – Paste Special; Undo


See all Microsoft Excel tips

Images

Fig. 288Fig. 289Fig. 290Fig. 291Fig. 292

Bright Hub - Science & Technology Articles, Buyer's Guides, How-To Tips and Software Reviews
About Bright Hub | Contact Us | Terms of Use | Privacy Policy | Copyright Policy | ©2008 Bright Hub Inc. All rights reserved. Page copy protected against web site content infringement by Copyscape