This post is authored by Martin, one of our readers.
Situation:
Sometimes I encounter data in my tables with blank cells where there is a repeated value from the cell directly above. See below:

This can be annoying when it comes to interpreting the data and when sorting columns.
Solution:
Here’s the solution I use.
1. Select the whole table. I favor the shortcut Ctrl A to do this. Make sure you perform this shortcut from within the table though as otherwise the entire worksheet with be selected. This gives us Figure 2:

2. Next we will open the Go To dialog box. This is a very useful dialog for selecting certain types of cells, for example cells containing formulas, constant values, visible cells and so on. F5 or Ctrl G both work as keyboard shortcuts.
3. Click the Special button (see Figure 3)

4. In the next screen select Blanks.

5. Click OK and notice that all blank cells are now highlighted in the table (Figure 5). Notice too, the position of the active cell. This is the one un-shaded cell in this selection. In this example it is cell D3. If the table were fully complete this cell would show the same value as the cell above it – cell D2 – the word Office.

6. Next we will use the fact that cell references in Excel by default behave in a relative manner. That means when you copy a formula to another cell, the cell reference in the formula change relative to the location in the worksheet it has been moved to unless they have been made absolute.
7. Without clicking any of the cells in the data, simply enter the following simple formula:
=D2
If you are following along here with a different table, then you will substitute the cell reference of the cell directly above your active cell. (Figure 6)

8. Next the important part. We need to copy this simple formula to all the other blank cells which could number in the hundreds or thousands or greater still. How do we do it?
Simply by using one of the best keyboard shortcuts I know in Excel: Ctrl & Enter.
This shortcut when used in a single cell will enter the value inputted into the cell and keep that cell active, instead of performing a carriage return to the next row.
But, when used over a range of cells, Ctrl & Enter together will copy the value of the active cell into all cells in the selection.
In this case, we are not going to copy the value of D2 into all blank cells, but the relative cell that appears over each blank cell. In cell D3’s case this was D2. In A3’s case for example it is A2 and so on.
After CTRL Entering the formula the worksheet now looks like:

9. There is one last important step. These pasted valued are, as we have seen, relative formulas. If I were to change the sort order in one of the columns, for example to identify which Cost in column E is the highest, my table would be completed distorted as the formulas in the changing rows are all retrieving the value in the cell above. See Figure 8.

I’ll Undo my flawed Sort by clicking Ctrl Z.
The final step therefore is to change these formulas into constants so that this type of problem can be avoided.
To do this, select the table, (or if the formula cells remain highlighted, you won’t need to select the table at all).
Now copy your selection with Ctrl C.
Next, perform a Paste Special / Values to replace the formulas with their constant equivalents – Figure 9.

And that’s it!
Thank you Martin
Many thanks to Martin for sharing this simple yet very beautiful trick with all of us. If you enjoyed this article, say thanks to Martin.
How do you deal with Blank Cells
Barking dogs, bad bosses and blank cells are everywhere. I am eager to know how you deal with them. Please share your tips & techniques with us using comments.
More on Blank Cells and other Unclean Data
If you constantly deal with blank cells or other types of unclean data, read these articles to learn few more tricks.

















30 Responses to “Great News: Chandoo becomes MVP”
Congratulations! It's well deserved. 🙂
This is amazing. Hearty congratulations and a rocking new year ahead!!!
Congrats! I have learnt alot from your site... and the most important is learning how to achieve the most with the simplest concepts.
Thanks for the excel calendar. Is it possible to get a simple big fonted calendar printable on an A4 size paper without any distracive notes or visuals? BTW, I have already signed up for your newsletter. With warm regards and
Gratefully yours
50+ year old CHarish.
Hey Chandoo,
Great to hear that. Congratulations! The best new year gift, I would say. Keep it up, u've been doing extraordinary work for the excel users community.
Regards,
Pankaj Verma
Congrats dude... fantastic news!
congratulations! your site is great, this is well deserved
Rich
I recently found your site, I visit many. The tips that you provide are in the top 1% of all the sites I visit. Keep on Excelling.
Arnold
South Africa
Congratulations, Chandoo! That's a great way to start the year and make the PHD even better.
Congratulations, Chandoo.
Your site is one of most useful on the net. Happy new year and lot of ideas you will present for us.
Congrats.
Just read your name in an email from Abhishek. Well deserved.
Congratulations, and Happy New Year.
Greetings from Rio de Janeiro my friend! You trully deserve it!
Nive way to start 2009! Keep up the good work!
FC
That was quite forseeable , so you have now really got your PhD in excel.
Anyways Chandoo you have made excel a real Fun doo
I will like you to write some more on INDEX and MATCH function in near future.
@Hey Chandoo ! Congrates....
Ab to treat mangta hai !
Well deserved Chandoo!!
Congrat's!! Very well deserved 🙂
i always browsed mr.excel and used to see MVP writtne below names of people who used to solve queries in excel forum there......i just used to admire as to what they have special in them that they are MVP......
but now i got my answer...............u deserve it man..........
@All: thanks everyone 🙂
Congratulations Chandoo, nice job!
Chandoo,
A well deserved recognition and a good start to the New Year. Continue your good work.
Subbu
Many Congratulations.
You deserve a Ph.D. 🙂
congrats.....
Congrats dude. Rock on!
[...] charting community in 2007 and has been growing strongly ever since. In year 2009, I have received the MVP award from Microsoft. Just few days back I have become a dad [...]
Respected sir,
I am impressed!.... Good job done.. Keep it up...
Sir, How to be a MVP certified person. What level of knowledge is required for it? send me links if possible.
Please reply...
Regards,
Dipak Khalasi.
Dipak -
The first thing you need to cultivate is the ability to search the web effectively. You could start by Googling "Microsoft MVP".
[...] boy and girl which has been made hectic and incredibly fun ever since to their life.He has been awarded MVP status in 2009 by Microsoft(and renewed in 2010,2011 & 2012).His MVP profile is here.If you want to contact him direct then [...]
Congrats Chandoo!!
[…] Chandoo becomes MVP […]