Blanks in a Microsoft Excel spreadsheet aren’t always wrong, but they can throw a monkey wrench into expressions, analyzing and reporting. I don’t recommend leaving blanks unless you have specific reason for doing so. Blanks can be troublesome and downright destructive because some functions evaluate blanks differently than values. In this article, I’ll show you three quick and easy ways to deal with blank cells:
I’m using Microsoft 365, but you can use earlier versions. Methods two and three won’t work in Excel Online because there’s no Go To Special feature. For your convenience, you can download the .xlsx and .xls demonstration files.
Blank cells are easy to miss if you’re working with a lot of data, so you might want to highlight them. The best way to do so is with a conditional format. As you can see in Figure A, at least one cell in each column is blank. In such a small sheet, you’d quickly see them all, but in a busy sheet with many rows and columns, blanks are easy to miss unless you do something to make them stand out, which is what we’ll do now:
Figure A
Figure B
While this visual clue is helpful, you might not want blank cells at all. That means filling them with some kind of value.
Sometimes you’ll want to fill blanks with a specific value. For instance, the Accounting format enters a dash when you enter a 0, but that’s not exactly the same thing as filling a blank with a specific value. When this is the case, use the Go To dialog as follows:
Figure C
Figure D
This isn’t a dynamic solution. As you update data and add more blanks, you’ll need to run this quick task again. In this example, you entered a specific value, but that won’t always be what you want. In the next section, we’ll use same method to repeat the value above the blank cell.
Depending on where you receive your data, you might find that some blank cells should contain the value in the cell above. When this happens, you’ll probably want to fill in those blanks right away. If you have only a few, use the fill handle. If you have several, the fill handle is too time consuming. We’ll continue to work with the same data, even thought it’s a bit contrived within this context. Specifically, we’ll use the Go To feature to fill the missing values, but this time, we’ll enter a formula instead of a specific value:
Figure E
Figure F
At this point, you have a mixture of literal values and expressions. If you sort, those expressions won’t repeat the right data. You might think that won’t ever happen, but I do recommend that you change those expressions to literal values, just in case. It’s easy to forget that you’re working with a mixture of literals and expressions, and you might end up with erroneous data. Fortunately, this task is quick and easy:
Figure G
These three techniques aren’t interchangeable; the way you’re using your data will determine which method you choose.
From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays
From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays
Share ArticleSusan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.