METHOD 1: Use this array formula:
http://www.get-digital-help.com/2007/09/16/excel-remove-blank-cells/
METHOD 2: Other way to do it is:
I will give you the example with/without a header/label row
• row 1 are the labels/headers: Your data range goes from A2:A30
• You don’t have labels/headers on row 1: Your data range goes from A1:A30
STEP 1: SELECT THE TEMPORAL WORKING AREA
• Select 2 columns that will be used for temporal calculation. For the example it will be column H and I
STEP 2: ID THE BLANK CELLS
For any blank cell on column A, the equivalent cell on column H will have the value 0 otherwise it will be a 1
Copy this formula to cell:
• H2 (if you have header/label)
=IF(ISBLANK(A1), "0","1")
• H1 (you don't have header/label) =IF(ISBLANK(A1), "0","1")
Copy the above formula to the rest of the cells on column H (up to cell H30)
STEP 3: OBTAIN THE ROW NUMBER FOR NON BLANK CELLS
Copy this formula to cell:
• I2 (if you have header/label) =MATCH( "1", $H$2:$H$30, 0) + 1
• I1 (you don't have header/label) =MATCH( "1",$H$1:$H$30, 0)
Copy the above formula to the rest of the cells on column I (up to cell I30)
STEP 4: CREATE THE NEW LIST WITHOUT BLANK CELLS
Copy this formula to cell:
• B2 (if you have header/label) =IF(I2>30,"", INDIRECT( ADDRESS(I2,1)))
• B1 (you don't have header/label) =IF(I1>30,"", INDIRECT( ADDRESS(I1,1)))
Copy the above formula to the rest of the cells on column B (up to cell B30)
HINT: To get rid of the temporal columns and the formulas on column B:
Select column B, right-click and select COPY, right-click again and select PASTE SPECIAL, from the list mark the option VALUE and click the OK button,. Now you can delete column H and I
That's all