Oct
1

How to remove all blank rows in Excel

In this quick tip I will explain why deleting Excel rows via select blank cells -> delete row is not a good idea and show you 3 quick and correct ways to remove blank rows without destroying your data. All solutions work in Excel 2013, 2010 and lower.

3 quick and correct ways to remove blank rows in Excel

If you are reading this article, then you, like me, are constantly working with large tables in Excel. You know that every so often blank rows appear in your worksheets, which prevents most built-in Excel table tools (sort, remove duplicates, subtotals etc.) from recognizing your data range correctly. So, every time you have to specify the boundaries of your table manually, otherwise you will get a wrong result and it would take hours and hours of your time to detect and correct those errors.

There may be various reasons why blank rows penetrate into your sheets - you've got an Excel workbook from another person, or as a result of exporting data from the corporate database, or because you removed data in unwanted rows manually. Anyway, if your goal is to remove all those empty lines to get a nice and clean table, follow the simple steps below.

Never remove blank rows by selecting blank cells

All over the Internet you can see the following tip to remove blank lines:

  • Highlight your data from the 1st to the last cell.
  • Press F5 to bring the "Go to" dialog.
  • In the dialog box click the Special… button.
  • In the "Go to special" dialog, choose "Blanks" radio button and click OK.
  • Right-click on any selected cell and select "Delete…".
  • In the "Delete" dialog box, choose "Entire row" and click Entire row.

This is a very bad way, use it only for simple tables with a couple of dozens of rows that fit within one screen, or better yet - do not use it at all.

The main reason is that if a row with important data contains just one blank cell, the entire row will be deleted.

For example, we have a table of customers, 6 rows altogether. We want to remove rows 3 and 5 because they are empty.
We want to remove rows 3 and 5 because they are empty

Do as suggested above and you get the following:
Row 4 (Roger) is also gone because cell D4 in the

Row 4 (Roger) is also gone because cell D4 in the "Traffic source" column is empty: (

If you have a small table, you will notice a loss of data, but in real tables with thousands of rows you can unconsciously delete dozens of good rows. If you are lucky, you will discover the loss in a few hours, restore your workbook from a backup, and will do the job again. What if you are not so lucky or you do not have a backup copy?

Further in this article I will show you 3 fast and reliable ways to remove empty rows from your Excel worksheets. If you want to save your time - go straight to the 3rd way.

Remove blank rows using a key column

This method works if there is a column in your table which helps to determine if it is an empty row or not (a key column). For example, it can be a customer ID or order number or something similar.

It is important to save the rows order, so we can't just sort the table by that column to move the blank rows to the bottom.

  1. Select the whole table, from the 1st to the last row (press Ctrl + Home, then press Ctrl + Shift + End).
    Select the whole table
  2. Add AutoFilter to the table: go to the Data tab and click the Filter button.
     Add AutoFilter to the Excel table
  3. Apply the filter to the "Cust #" column: click the arrow Autofilter drop-down arrow in the column header, uncheck the (Select All) checkbox, scroll down to the end of the list (in reality, the list is quite long) and check the checkbox (Blanks) at the very bottom of the list. Click OK.
    Excel Autofilter: show empty rows only
  4. Select all the filtered rows: Press Ctrl + Home, then press the down-arrow key to go to the first data row, then press Ctrl + Shift + End.
    Select all the filtered rows
  5. Right-click on any selected cell and choose "Delete row" from the context menu or just press Ctrl + - (minus sign).
    Right-click on any selected cell and choose Delete row
  6. Click OK in the "Delete entire sheet row?" dialog box.
    Delete entire sheet row dialog box
  7. Clear the applied filter: go to the Data tab and press the Clear button.
     Clear the applied filter
  8. Well done! All the blank rows are completely removed, and line 3 (Roger) is still there (compare with the previous version).
    All the blank rows are completely removed

Delete blank rows if your table does not have a key column

Use this method if you have a table with numerous empty cells scattered across different columns, and you need to delete only those rows that do not have a single cell with data in any column.
Excel Table with numerous empty cells scattered across different columns

In this case we do not have a key column that could help us to determine if the row is empty or not. So we add the helper column to the table:

  1. Add the "Blanks" column to the end of the table and insert the following formula in first cell of the column: =COUNTBLANK(A2:C2).
    This formula, as its name suggests, counts blank cells in the specified range, А2 and C2 is the first and last cell of the current row, respectively.
    Excel formula to count blank cells in the specified range
  2. Copy the formula throughout the entire column. For step-by-tep instructions please see how to enter the same formula into all selected cells at a time.
    Copy the formula throughout the entire column
  3. Now we have the key column in our table :). Apply the filter to the "Blanks" column (see the step-by-step instructions above) to show only rows with the max value (3). Number 3 means that all the cells in a certain row are empty.
  4. Then select all the filtered rows and remove whole rows as described above.
    As a result, the empty row (row 5) is deleted, all the other rows (with and without blank cells) remain in place.
    Empty row (row 5) is deleted
  5. Now you can remove the helper column. Or you can apply a new filter to the column to show only those rows that have one or more blank cells.
    To do this, uncheck the "0" checkbox and click OK.
    uncheck the

    Show only those rows that have one or more blank cells

The fastest way to remove all empty rows - Quick Tools add-in for Excel

The quickest and impeccable way to remove blank lines is to use our add-in for Excel.

We are tired of wasting time on routine actions in Excel that look pretty simple, but in reality take 5-10 clicks. So, we have created the Quick Tools add-in for Excel, a set of one-click utilities that are of great help in everyday work with Excel worksheets.

The utilities will help you move columns by drag-n-dropping; delete all empty cells, rows and columns; filter by the selected value, calculate percentage, apply any basic math operation to a range; copy cells' addresses to clipboard, synchronize selection on different sheets and much more.

How to remove empty rows in 3 simple clicks

  1. Download and install Quick Tools for Excel.
  2. Click on any cell in your table.
  3. Go to the "Ablebits.com Quick tools" tab and click the "Empty rows" button.
    Click the Empty rows button
  4. Click OK to confirm that you want to remove empty rows.
    Confirm that you want to remove empty rows

    Just 3 clicks and you've got a clean table, all empty rows are gone and the rows order is not distorted!
    All empty rows are gone and the rows order is not distorted

Video: How to remove blank rows in excel

85 Responses to "How to remove all blank rows in Excel"

  1. prabhakar says:

    nice.......

  2. Asad says:

    110% applicable. I've tried personally.

  3. Asad says:

    Dont try F5 way to del, very nice tutorial. thanks alot bro

  4. Prawin says:

    Thank you very much for the article. Very helpful.

  5. Lynn says:

    Thank you for this tip,
    I'm looking to remove empty columns (and yes, I did inadvertently nuke valuable data by using the online recommendation for the find/special/blanks method-arghh.)

    I would like to purchase your product for download but my company is paranoid about any downloads that aren't authorized.
    Do you have some sort of "safety" insurance that I could provide to our CTO to assure them that there isn't a bug or other problematic hidden code in your software?
    Thanks much,
    Lynn

  6. Thillai says:

    Very thanks boss..

  7. Eban says:

    Just wanted to point out that the options suggested above which use Key column and filter will only work when you are working with filters within a table. This is a just a small nuance that makes a big difference. If you do try to filter without a table, you will delete all rows that are not seen as well.

    Thanks for this post Alex. Found it very helpful!

  8. Anonymous says:

    this worked wonders thanks

  9. Leon says:

    Finally! The F5 option is available everywhere, but messed up my lists - this was exactly what I wanted, thanks a lot =)

  10. Shellie-Ann says:

    Life Saver!

  11. Crazoid says:

    did not help me as i hve data with merges fields and i want to delete only the rows which are completely empty in all the cells

  12. John says:

    The instructions were great! What a time saver. Thanks!

  13. D Uttam says:

    i used to do
    1>just filter blank only
    2> insert one row
    3> delete which row i insert
    4> now i can delete in one click all blank row

  14. Sri says:

    Works simply wonderful! You have to copyright this boss or Microsoft is going to steal this idea!

  15. Mason says:

    If you have unique data in each row or wish to only keep unique records, another way is to select all data, go to Data -> Remove duplicates. A pop-up will appear and you can select the column you wish to use as your key. it will remove all blank rows after the first blank row in that column. Repeat for each column that has blank rows.

  16. NIRANJAN says:

    Thanks a ton,something new i learned.

  17. samrat says:

    Thank you Alexander :)

  18. Dulan says:

    i cant find the albeits quick tool on excel. help

  19. Cheryll says:

    Thanks! I've been doing this the long way for far too long. This was excellent help!

  20. Anonymous says:

    it really helped...many thanks..

  21. Sateesh says:

    Hello, When I tried to remove the empty rows using the Option 1,i.e (Apply filter to key column), the first row is also being deleted after the data is filtered.
    i.e I don't see the first row after deleting the empty rows. When I press Ctrl+Home after filtering, the first row is also getting included along with blank rows.
    Any idea , How to get rid of this??

  22. worker says:

    is there a way to delete the rows on the bottom of my work sheet so i only see the data that i am finished with.

  23. phani says:

    Thank u very much. Saved my precious time.

  24. nana eddie says:

    Hi,

    In fact your tutorial was very helpful to me and I really thank you for that. Hope to learn a lot from you. Thanks once again.

  25. Jade says:

    This crap doesn't work for large data sets, whats the point?

  26. ThanQ says:

    Its really useful to me and saved my lots of time.

  27. ThanQ says:

    Really useful to me and saved my lots of time.

  28. Ahmed Tarek says:

    Very Nice Macro

  29. Ahmed Tarek says:

    thanks a ton

  30. andrea says:

    good job

  31. Francois says:

    Hi,
    Excellent tutorial! One question I still have.... I have a sheet with 110,000 rows, with 35381 blank rows. When I try your second method "Remove blank rows using a key column" after I select the delete row option I get the following error:
    "Excel cannot create or use the data range reference because it is too complex. Try one or more of the following:
    - use data that can be selected in one contiguous rectangle
    - use data from the same sheet"

    obviously I'm working on the same sheet, and this method is only works because we're not selecting a contiguous rectangle....
    I'm wondering what my options are.

    Thanks in advance for your help,

    Francois

  32. Ahmad Zakarneh says:

    thank you so much
    =countblanks() is very good way

  33. DEEPAK says:

    Thnks....
    really very helpful...

  34. Gaurav Jain says:

    Thanks a lot friend.
    Appreciated.

  35. JAIMI says:

    Hi,

    I have all these extra lines below my data and it is making scrolling difficult. Is there a way to remove all of the lines below my data without them popping back up.

    Thanks.

  36. Anonymous says:

    very helpful

  37. Cindy says:

    Thank you so much!!!

  38. Mandana says:

    Thank you SOOOOOOOOOOO much. well described, great help!

  39. Akanksha says:

    It was very effective! Thanks a ton!! :)

  40. Steve says:

    Thanks Alex, invaluable little tutorial, was having issues with the ubiquitous 'Go to Special >Blanks etc' that you refer to in your first paragraph. Nice to see a more considered approach :)

  41. littleclam says:

    Is there a way to remove blank rows by formulas instead of filtering?

  42. Cliff T. says:

    Thank you!!

  43. Jess says:

    Superb, especially with such a detail explaination.
    thx heaps :)

  44. Nolan says:

    Thank you very much saved a lot of time.

  45. Fredrick Gatiramu says:

    Thanks for this informative tutorial

  46. Lokesh P says:

    Hello Team,

    Could you please hlep me to remove the blank columns(I have all header column names but no data). Here I have to remove no data columns(with name).

    Thanks in advance. :)

    LOkesh P

  47. Mohammad Yusuf says:

    Thanks :) it is very helpful

  48. Ashok says:

    Very Nice post.

  49. Amr says:

    Very useful tool, thanks a lot ,it is helpfull

  50. Toni says:

    Thank you :)

  51. James says:

    Thank you :) Very Helpful

  52. Paolo says:

    The only solution that works!Thank u man!

  53. m says:

    Option 3 works easy.Thankyou

  54. Tamer says:

    Thanks A lot, it worked.
    You've just saved me an hour of dull work and taught me something new. Thanks again

  55. Jo says:

    Oh my..this is so helpful. Thanks a lot!!!!

  56. Ana says:

    Very Helpful. Thank you.

  57. viraj says:

    Thank you very much keep up the good work

  58. Logan says:

    Didnt work for me. Tried it twice

  59. Pankaj Chauhan says:

    Nice trustworthy tutorial over other faulty tricks shown on internet

  60. Suga says:

    Thank you. Very detailed explanation.

  61. Chandana says:

    Excellent post. Thanks a lot.

  62. mas says:

    very helpful.thanks a lot.

  63. Arun says:

    Thank u great work

  64. Suresh Vijayakumar says:

    Fantastic short cut and saves much time...thanks a lot and appreciated..

  65. Judy says:

    Elegant! Thank you!

  66. Stan says:

    The 3rd option is what I tried and it works up to the point that I clear the filter and the screen seems to freeze. The data is still there but you can't seem to click on anything. I say "seems" because I found out that the program is still working like it should it's just that the screen doesn't refresh. I just click the X and save the work. When you return to the program it works correctly without the blank rows.

  67. Dave says:

    Brilliant!

  68. Siaka says:

    it worked perfectly, thank so much

  69. rajeev says:

    Hi,

    the first two worked but I downloaded your quick tools add in but it is not recogniszing the empty rows and once the tool runs, it shows 0 empty rows.

    can you help me in this.

    regards,

    rajeev

  70. rajeev says:

    Hi,

    the first two worked but I downloaded your quick tools add in but it is not recognizing the empty rows and once the tool runs, it shows 0 empty rows.

    can you help me in this.

    regards,

    rajeev

  71. teojb says:

    thanks. worked perfectly. saved me some time

  72. Bill says:

    Perfect. I was one of the people trying the F5 method and pulling my hair out. This worked exactly as you said it would.
    Thanks a bunch for the help.

  73. Guv says:

    Thanks that was perfect bro

  74. Dey says:

    This has saved my life!!!! I was sent tons of spreadsheets with awful structure and now I won't have to spend this entire century trying to manipulate them... Thank you so much !

  75. Ananth says:

    Thanks a lot for the tutorial.
    'Remove blank rows using a key column' was helpful.

  76. jagadeesh says:

    i my excel sheet there are 1600 rows.when i apply filter( by text or number).it is not applying to the entire sheet.it is applying only upto range of 50 or 100 rows.its becoming difficult to filter function apply again and again. ** my sheet has blank CELLS also**

  77. zev says:

    I have a list of names with 2 empty rows between after every second name on the list (i.e. 2 rowns with names and two blank rows). I want to delete only 1 empty row and leave the second empty row as it is. Any ideas?

  78. Adrian says:

    Actually, I just found a great, super quick way to get rid of extra rows...

    1) save the original Excel file as "tab-delimited" text file, then...
    2) open that file in notepad or TextEdit (Mac), then
    3) in the text app select the whole empty row (triple click on Mac)
    4) do a "find" in the text app, paste the empty-row and click "replace" with empty field (nothing)
    5) then just click "replace all" and boom! all those damn empty rows gone!

    Then just copy-paste back into Excel :)

    At any rate, I tried this on my Mac, and it worked like a charm, I'm not sure if Notepad on the PC has the same find-replace as the Mac's TextEdit, I assume it does, but if it doesnt then maybe you can try another basic word-processing app that allows simple find-and-replace

    Good luck!

Post a comment



Unfortunately, due to the volume of comments received we cannot guarantee that we will be able to give you a timely response. When posting a question, please be very clear and concise. We thank you for understanding!
Excel add-ins and Outlook tools - Ablebits.com
Ultimate Suite for Excel Professionals
 
 
60+ professional tools for Excel 2016-2007 to do your daily work
Incredible product, even better tech support…AbleBits totally delivers!
Deborah Bryant
Anyone who works with Excel is sure to find their work made easier
Jackie Lee
The best spent money on software I've ever spent!
Patrick Raugh
Ablebits is a fantastic product - easy to use and so efficient.
Debra Celmer
Excel is at its best now
Annie C.
I don't know how to thank you enough for your Excel add-ins
Jennifer Morningstar
Anybody who experiences it, is bound to love it!
Kumar Nepa
AbleBits suite has really helped me when I was in a crunch!
Nelda Fink
I have enjoyed every bit of it and time am using it
Christian Onyekachi Nwosu
It's the best $100 we've ever spent!
Mike Cavanagh
I love the program, and I can't imagine using Excel without it!
Robert Madsen
One word… WOW!
Dave Brown
Love the products!
David Johnston
It is like having an expert at my shoulder helping me…
Linda Shakespeare
Your software really helps make my job easier
Jeannie C.
Thanks for a terrific product that is worth every single cent!
Dianne Young
I love your product
Brad Gibson
Awesome!!!
Sheila Blanchard