In this article you'll learn a trick to select all empty cells in an Excel spreadsheet at once and fill in blanks with value above / below, with zero or any other value.
To fill or not to fill? This question often touches blank cells in Excel tables. On the one hand, your table looks neater and more readable when you don't clutter it up with repeating values. On the other hand, Excel empty cells can get you into trouble when you sort, filter the data or create a pivot table. In this case you need to fill in all the blanks. There are different methods to solve this problem. I will show you one quick and one VERY quick way to fill empty cells with different values in Excel.
Thus my answer is "To Fill". And now let's see how to do it.
How to select empty cells in Excel worksheets
Before filling in blanks in Excel, you need to select them. If you have a large table with dozens of blank blocks scattered throughout the table, it will take you ages to do it manually. Here is a quick trick for selecting empty cells.
- Pick the columns or rows where you want to fill in blanks.
- Press Ctrl + G or F5 to display the Go To dialog box.
- Click on the Special button.
Note. If you happen to forget the keyboard shortcuts, go to the Editing group on the HOME tab and choose the Go To Special command from the Find & Select drop-down menu. The same dialog window will appear on the screen.
The Go To Special command allows you to select certain types of cells such as ones containing formulas, comments, constants, blanks and so on.
- Select the Blanks radio button and click OK.
Now only the empty cells from the selected range are highlighted and ready for the next step.
Excel formula to fill in blank cells with value above / below
After you select the empty cells in your table, you can fill them with the value from the cell above or below or insert specific content.
If you're going to fill blanks with the value from the first populated cell above or below, you need to enter a very simple formula into one of the empty cells. Then just copy it across all other blank cells. Go ahead and read below how to do it.
- Leave all the unfilled cells selected.
- Press F2 or just place the cursor in the Formula bar to start entering the formula in the active cell.
As you can see in the screenshot above, the active cell is C4.
- Enter the equal sign (=).
- Point to the cell above or below with the up or down arrow key or just click on it.
The formula
(=C3)
shows that cell C4 will get the value from cell C3. - Press Ctrl + Enter to copy the formula to all the selected cells.
Here you are! Now each selected cell has a reference to the cell over it.
Note. You should remember that all cells that used to be blank contain formulas now. And if you want to keep your table in order, it's better to change these formulas to values. Otherwise, you'll end up with a mess while sorting or updating the table. Read our previous blog post and find out two fastest ways to replace formulas in Excel cells with their values.
Use the Fill Blank Cells add-in by Ablebits
If you don't want to deal with formulas every time you fill in blanks with cell above or below, you can use a very helpful add-in for Excel created by Ablebits developers. The Fill Blank Cells utility automatically copies the value from the first populated cell downwards or upwards. Keep on reading and find out how it works.
- Download the add-in and install it on your computer.
After the installation the new Ablebits Utilities tab appears in your Excel.
- Select the range in your table where you need to fill empty cells.
- Click the Fill Blank Cells icon on the Ablebits Utilities tab.
The add-in window displays on the screen with all the selected columns checked.
- Uncheck the columns that don't have empty cells.
- Select the action from the drop-down list in the bottom-right corner of the window.
If you want to fill the blanks with the value from the cell above, choose the Fill cells downwards option. If you want to copy the content from the cell below, then select Fill cells upwards.
- Press Fill.
Done! :)
Besides filling empty cells, this tool will also split merged cells if there are any in your worksheet and indicate table headers.
Check it out! Download the fully-functional trial version of the Fill Blank Cells add-in and see how it can save you much time and effort.
Fill empty cells with 0 or another specific value
What if you need to fill all the blanks in your table with zero, or any other number or a specific text? Here are two ways to solve this problem.
Method 1
- Select the empty cells.
- Press F2 to enter a value in the active cell.
- Type in the number or text you want.
- Press Ctrl + Enter.
A few seconds and you have all the empty cells filled with the value you entered.
Method 2
- Select the range with empty cells.
- Press Ctrl + H to display the Find & Replace dialog box.
- Move to the Replace tab in the dialog.
- Leave the Find what field blank and enter the necessary value in the Replace with text box.
- Click Replace All.
It will automatically fill in the blank cells with the value you entered in the Replace with text box.
Whichever way you choose, it will take you a minute to complete your Excel table.
Now you know the tricks for filling in blanks with different values in Excel 2013. I am sure it will be no sweat for you to do it using a simple formula, Excel's Find & Replace feature or user-friendly Ablebits add-in.
198 comments
worked perfectly thank you!!
Hi,
I have tried the same steps multiple times, however I have a large dump of excel data and when I do this, it fills in all the blanks with "0" instead of the text above
Eg:
Jupiter
Jupiter
Jupiter
Saturn
Saturn
Saturn - Correct answer
However, what I am getting is
Jupiter
0
0
0
Saturn
0
0
0 - Incorrect
How do I correct this?
Hi! From your description, it is difficult to have a full understanding of your task.
What formula will I use to automatically fill 0 in blank excel cells that is connected to a server via API which auto updates every minute
Hi! If the cell has no formula or value, you can use VBA to write a value of 0. If the value of a cell depends on other cells, you can write an IF formula into the cell.
You can also fill blank cells with one click using the Fill Blank Cells tool. It is available as a part of our Ultimate Suite for Excel that you can install in a trial mode and check how it works for free.
how can we do from a table value cells to replaces with 1.
Hi! To replace the values in the cells with 1, you can use Paste Special. If this is not what you need, please clarify your question.
There is an easier way to add a 0 to blank cells - highlight the entire table, go to replace - leave the "find what" box empty and type "0" in the replace with box and hit "replace all"
Thank you for Excellent guidance , its worked
Hi,
If the vlookup result of min is blank and needs to automatically take the previous non-blank cell value of the result range.
Hi!
It is impossible to give you exact advice since you have not written your VLOOKUP formula. Also explain what "previous non-blank cell" means. Please provide me with an example of the source data and the expected result.
Is there a way to do this the other way around - zeros to blanks?
I have a master workbook, and the range B2:B5000 contains codes in cells B2:15 which will be updated periodically.
Workbook X refers to this range in column B. Excel returns zeros in cells where there is currently no data in the range B2:B5000 in the master workbook.
In workbook X, I need to extract all the codes into another list and eliminate the zeros so I used the formula below.
=IFERROR(INDEX($B$2:$B$5000,SMALL(IF(ISTEXT($B$2:$B$5000),ROW($B$1:$B$4999)), ROW(B1))),"")
This only works if the cells in the range in the master workbook contains alphanumeric strings. Is there a formula I can use that will work if the strings are only numeric?
Hi!
If you want to extract text and numbers from a range, use the ISBLANK function to exclude empty cells.
=IFERROR(INDEX($B$2:$B$5000,SMALL(IF(NOT(ISBLANK($B$2:$B$5000)),ROW($B$1:$B$4999)), ROW(B1))),"")
Works perfectly, thank you Alexander!
I've just realised that this doesn't work the way I want unfortunately. Whilst this does extract both text and numbers now, it does not eliminate zeros.
This is what I require:
MRK456 should return MRK456
187456 should return 187456
0 should return a blank
Can this formula be tweaked so that it extracts all text and number strings but also onvert any cells with 0 to blank cells?
Hi!
Add a condition using the IF function to replace 0 with a space.
IF([formula]=0,"",[formula])
Thanks a million!
Useful; thanks a lot! It solved my problem :)
Hi - Use this command often. However, today I ran across an error "no cells were found". Changed the format of the number to text and back to number; still getting the message. Any idea on how to bypass?
Hello!
Try to use the recommendations described in this article: How to convert text to number in Excel.
I hope it’ll be helpful.
thank you soooo much.
very helpful
very very helpful - thank you
I don't know how much I can than you. But, any way, Thanks!
That was brilliant useful, Thank you so much!