Excel tip: How to fix #VALUE! errors
The next instalment of David H Ringstrom’s trans-Atlantic series of Excel tips tackles the pesky problem of #VALUE! alerts.
It’s frustrating when Excel shows #VALUE! in a cell rather than the expected result. Sometimes the reason is obvious, for example if you’ve tried to do a calculation that mixes text and numbers, but sometimes the culprit can be harder to pin down.
In the example below, the formula =C2/A2 returns #VALUE! because the formula attempted to divide the value 5000 in cell C2 by the word Apples in cell A2. The same mistake would occur if I tried to divide cell A2 by C2, or add or subtract one of those cells from the other. With that said, I could sum cells A2 through C2, as in =SUM(A2:C2), and the result would be 5500 and not #VALUE.
However if cell D2 contained the formula =C2/B2 and cell C2 was blank, Excel should return. You could still encounter a #VALUE! error if cell C2 was not truly blank. Users sometimes erase values by tapping the spacebar, occasionally by accident. This makes the cell appear blank when it isn’t. Before we explore this further, keep in mind that if cell B2 is blank but C2 contains a number, then the formula =C2/B2 will return a #DIV/0! error, which signifies division by zero.
Sharp-eyed users can press F2 within a cell and then make note of where the blinking cursor is, as shown below. If the cursor is adjacent to the left border of the cell, the cell is most likely blank. However, if the cursor is a couple of millimetres to the right, then there’s a space. To categorically check, click once on a cell, and then press the Delete key.
You can also use the ISBLANK worksheet function to determine whether a cell is blank or not. For instance, the formula =ISBLANK(C2) will return TRUE if cell C2 is blank or FALSE if it isn’t.
Curiously, if you’re doing simple arithmetic with cells that contain numbers stored as text, Excel will perform the calculation without issue. To try this out, type a single quote in cell B2, followed by a number such as 500 and then two spaces. In cell C2, enter a single quote followed by 5000 and two spaces. In cell D2, the formula =C2/B2 will return 10. Of course, if you were to try to sum the current values of cells B2 and C2, the SUM function would return 0, because worksheet functions don’t generally convert text to numbers on the fly. Should you encounter numbers stored as text, the easiest solution is to use the Text to Columns wizard:
- Select one or more cells in a single column, choose Text to Columns from the Data tab or menu, and then click Finish.
This technique only allows you to convert one column at a time. If you need to convert multiple columns:
- Enter the number 1 in a blank worksheet cell and then copy it to the clipboard.
- Select the range of cells you wish to convert to values and then right-click and choose Paste Special.
- Double-click on Multiply.
This action will multiply all of the values by 1, which in turn also converts them to numeric values instead of text.
Regardless, there are other situations in Excel that can cause the #VALUE! error, such as a recalculating a linked reference to a closed workbook or including a text-based reference in a formula that’s expecting a value, such as =SUM("Apples",5,500). The Microsoft website offers additional guidance as well.
"Either you work Excel, or it works you!" says David Ringstrom CPA, the head of Atlanta-based software and database consultancy Accounting Advisors. He presents Excel training webcasts for CPE Link and contributes articles on Excel to AccountingWEB and Microsoft Professional Accountant's Network newsletter. He can be reached by email at david[AT]acctadv.com. More Excel tips from David H Ringstrom available here.