{"id":9220,"date":"2019-01-10T14:47:25","date_gmt":"2019-01-10T13:47:25","guid":{"rendered":"https:\/\/www.myexcelonline.com\/?p=9220"},"modified":"2024-02-06T16:09:19","modified_gmt":"2024-02-06T15:09:19","slug":"remove-rows-using-power-query","status":"publish","type":"post","link":"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/remove-rows-using-power-query\/","title":{"rendered":"Remove Rows Using Power Query"},"content":{"rendered":"<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/installing-power-query-excel-2010\/\" target=\"_blank\" rel=\"noopener noreferrer\">Power Query<\/a> lets you perform a series of steps to transform your messy Excel data.<\/p>\n<p>One of the most common steps I do, is \u00a0to <strong>clean my data and remove rows,<\/strong> and <a class=\"wpil_keyword_link\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/50-things-you-can-do-with-excel-power-query\/\" target=\"_blank\" rel=\"noopener\" title=\"Power Query\" data-wpil-keyword-link=\"linked\">Power Query<\/a> gives you a lot of options to do so!<\/p>\n<p>Here is our source table that we want to modify:<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-01.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9223\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-01.png\" alt=\"Remove Rows Using Power Query\" width=\"362\" height=\"333\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-01.png 362w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-01-300x276.png 300w\" sizes=\"(max-width: 362px) 100vw, 362px\" \/><\/a><\/p>\n\n<p>Let\u2019s go through the steps in detail:<\/p>\n<div class=\"after-post-box\">\n<p><iframe src=\"https:\/\/www.youtube.com\/embed\/TMcxNiZSMpk?rel=0 \" width=\"800\" height=\"400\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><a href=\"https:\/\/www.youtube.com\/c\/MyExcelOnlinecomtutorials?sub_confirmation=1\" target=\"_blank\" rel=\"noopener noreferrer nofollow\"><img loading=\"lazy\" decoding=\"async\" class=\"alignmiddle wp-image-111468 size-full\" style=\"vertical-align: middle;\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/04\/1.yt_.png\" alt=\"\" title=\"\"><\/a><\/p>\n<p class=\"line-two\"><a class=\"IRPP_minimalist icon-download button small\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-.xlsx\" target=\"_blank\" rel=\"noopener noreferrer\" data-leadbox=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-.xlsx\" data-leadbox-id=\"147284833f72a2:12f08263ab46dc\"><span class=\"ctaText px-3 text-capitalize\"> download excel workbook <i class=\"fa fa-download\"><\/i><\/span><span class=\"postTitle px-3\">Remove-Rows-.xlsx<\/span><\/a><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>STEP 1<\/strong>:<\/span>\u00a0Our sample data\u00a0contains the Sales numbers for\u00a0each month. Let us first prepare to use this data in Power Query.<\/p>\n<p>Go to <strong><em>Data &gt; Get &amp; Transform &gt; From Table (Excel 2016) <\/em><\/strong><em>or<\/em><strong><em> Power Query &gt; Excel Data &gt; From Table (Excel 2013 &amp; 2010)<\/em><\/strong><\/p>\n<p><span style=\"color: #0000ff;\"><strong>Excel 2016:<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-02.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9224\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-02.png\" alt=\"Remove Rows Using Power Query\" width=\"508\" height=\"537\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-02.png 508w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-02-284x300.png 284w\" sizes=\"(max-width: 508px) 100vw, 508px\" \/><\/a><\/p>\n<p><span style=\"color: #0000ff;\"><strong>Excel 2013 &amp; 2010:<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/from-table.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3239\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/from-table.png\" alt=\"from table\" width=\"777\" height=\"129\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/from-table.png 777w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/from-table-300x50.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/06\/from-table-768x128.png 768w\" sizes=\"(max-width: 777px) 100vw, 777px\" title=\"\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 2:<\/span> <\/strong>This will open up the Power Query Editor.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-03.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9225\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-03.png\" alt=\"Remove Rows Using Power Query\" width=\"278\" height=\"291\" \/><\/a><\/p>\n<p>If you go to\u00a0<em><strong>Home &gt; Reduce Rows &gt; Remove Rows<\/strong><\/em><\/p>\n<p>There are a lot of options! Let us see these 3 in action:<\/p>\n<ul>\n<li>Remove Top Rows<\/li>\n<li>Remove Bottom Rows<\/li>\n<li>Remove Alternate Rows<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-04.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9226\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-04.png\" alt=\"Remove Rows Using Power Query\" width=\"597\" height=\"249\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-04.png 597w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-04-300x125.png 300w\" sizes=\"(max-width: 597px) 100vw, 597px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong style=\"line-height: 1.5;\"><span style=\"color: #ff0000;\">STEP 3:<\/span> <\/strong><span style=\"line-height: 1.5;\">Go to\u00a0<em><strong>Home &gt; Reduce Rows &gt; Remove Rows &gt; Remove Top Rows<\/strong><\/em><\/span><\/p>\n<p>Let us try to remove the first two rows. Input\u00a0<strong>2<\/strong> as the number of rows.\u00a0<strong>Click OK.<\/strong><\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-05.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9227\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-05.png\" alt=\"Remove Rows Using Power Query\" width=\"699\" height=\"249\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-05.png 699w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-05-300x107.png 300w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/a><\/p>\n<p>You can see\u00a0<strong>January and February\u00a0<\/strong>are now removed.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-06.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9228\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-06.png\" alt=\"Remove Rows Using Power Query\" width=\"267\" height=\"247\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong style=\"line-height: 1.5;\"><span style=\"color: #ff0000;\">STEP 4:<\/span> <\/strong><span style=\"line-height: 1.5;\">Go to\u00a0<em><strong>Home &gt; Reduce Rows &gt; Remove Rows &gt; Remove Bottom Rows<\/strong><\/em><\/span><\/p>\n<p>Let us try to remove the bottom two rows. Input\u00a0<strong>2<\/strong> as the number of rows.\u00a0<strong>Click OK.<\/strong><\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-07.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9229\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-07.png\" alt=\"Remove Rows Using Power Query\" width=\"699\" height=\"249\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-07.png 699w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-07-300x107.png 300w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/a><\/p>\n<p>You can see\u00a0<strong>November and December\u00a0<\/strong>are now removed.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-08.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9230\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-08.png\" alt=\"Remove Rows Using Power Query\" width=\"267\" height=\"199\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong style=\"line-height: 1.5;\"><span style=\"color: #ff0000;\">STEP 5:<\/span> <\/strong><span style=\"line-height: 1.5;\">Go to\u00a0<em><strong>Home &gt; Reduce Rows &gt; Remove Rows &gt; Remove Alternate Rows<\/strong><\/em><\/span><\/p>\n<p>This is a bit trickier to use. Let us say we want to remove the following months: 3 (March), 6 (June) and 9 (September).<\/p>\n<p>To do that, let us input the following:<\/p>\n<ul>\n<li><strong>First row to remove<\/strong> &#8211; 1<\/li>\n<li><strong>Number of rows to remove<\/strong> &#8211; 1<\/li>\n<li><strong>Number of rows to keep<\/strong> &#8211; 2<\/li>\n<li><strong>Click OK.<\/strong><\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-09.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9231\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-09.png\" alt=\"Remove Rows Using Power Query\" width=\"699\" height=\"306\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-09.png 699w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-09-300x131.png 300w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/a><\/p>\n<p>This will remove starting from the first row, then the pattern is that row will be removed, then skip the next 2 rows, then do the same pattern again. Essentially it means\u00a0<strong>removing the first row of every 3 rows<\/strong>.<\/p>\n<p>You can see\u00a0<strong>March, June, and September\u00a0<\/strong>are now removed.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-10.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9232\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-10.png\" alt=\"Remove Rows Using Power Query\" width=\"274\" height=\"144\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>STEP 6: <\/strong><\/span>Click <strong>Close &amp; Load<\/strong> from the <strong>Home<\/strong> tab and this will <strong>open up a brand new worksheet<\/strong> in your Excel workbook with the new\u00a0data.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-11.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9233\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-11.png\" alt=\"Remove Rows Using Power Query\" width=\"521\" height=\"345\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-11.png 521w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-11-300x199.png 300w\" sizes=\"(max-width: 521px) 100vw, 521px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>You now have your new Excel table with the cleaned up rows!<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-12.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Remove Rows Using Power Query\"  class=\"alignnone size-full wp-image-9234\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-12.png\" alt=\"Remove Rows Using Power Query\" width=\"315\" height=\"405\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-12.png 315w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2018\/08\/Remove-Rows-12-233x300.png 233w\" sizes=\"(max-width: 315px) 100vw, 315px\" \/><\/a><\/p>\n<p><strong>Further Learning:<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/delete-steps-until-end-in-power-query\/\" target=\"_blank\" rel=\"noopener\">Delete Steps Until End In Power Query<\/a><\/li>\n<li><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/comment-in-query-steps-in-power-query\/\" target=\"_blank\" rel=\"noopener\">Comment In Query Steps In Power Query<\/a><\/li>\n<li><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/extract-length-using-power-query-or-get-transform\/\" target=\"_blank\">Extract Length Using Power Query<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/100-39.html\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" title=\"Free Excel Webinar Online Training Courses\"  class=\"alignnone\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/530x300.jpg\" alt=\"Free Excel Webinar Online Training Courses\" width=\"530\" height=\"300\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Power Query lets you perform a series of steps to transform your messy Excel data. One of the most common steps I do, is \u00a0to clean my data and remove rows, and Power Query gives you a lot of options to do so! Here is our source table that we want to modify: Let\u2019s go [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":17213,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cos_headline_score":0,"cos_seo_score":0,"cos_headline_text":"","cos_headline_has_been_analyzed":false,"cos_last_analyzed_headline":[],"om_disable_all_campaigns":false},"categories":[120,121],"tags":[117,470],"acf":[],"_links":{"self":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/9220"}],"collection":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/comments?post=9220"}],"version-history":[{"count":0,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/9220\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media\/17213"}],"wp:attachment":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media?parent=9220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/categories?post=9220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/tags?post=9220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}