{"id":4933,"date":"2016-11-04T17:07:11","date_gmt":"2016-11-04T16:07:11","guid":{"rendered":"https:\/\/www.myexcelonline.com\/?p=4933"},"modified":"2024-02-06T16:09:04","modified_gmt":"2024-02-06T15:09:04","slug":"create-index-columns-using-power-query","status":"publish","type":"post","link":"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/create-index-columns-using-power-query\/","title":{"rendered":"Create Index Columns 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 Excel data. One of the most common steps I do, is I want to\u00a0<strong>add an index column that serves as a row counter\u00a0<\/strong>of my data.<\/p>\n<p>There is the alternative method of using the ROW <a class=\"wpil_keyword_link\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/top-excel-formulas-function-examples-to-get-better-at-microsoft-excel\/\" target=\"_blank\" rel=\"noopener\" title=\"formula\" data-wpil-keyword-link=\"linked\">formula<\/a> in Excel.<\/p>\n<p>However if we simply want to keep it as a temporary column for data analysis, we can generate the Row Numbers using <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>.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-04.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Create Index Columns Using Power Query\"  class=\"alignnone size-full wp-image-5155\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-04.png\" alt=\"Create Index Columns Using Power Query\" width=\"366\" height=\"287\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-04.png 366w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-04-300x235.png 300w\" sizes=\"(max-width: 366px) 100vw, 366px\" \/><\/a><\/p>\n<p>Thankfully Power Query has an option that allows us\u00a0to create <strong>Index\u00a0Columns<\/strong>!<\/p>\n<div class=\"after-post-box\">\n<p><iframe src=\"https:\/\/www.youtube.com\/embed\/H_MK7oEAsU0?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\/2016\/11\/Index-Columns.xlsx\" target=\"_blank\" rel=\"noopener noreferrer\" data-leadbox=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns.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\">Index-Columns.xlsx<\/span><\/a><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Let\u2019s go through the steps in detail:<\/p>\n<p><span style=\"color: #ff0000;\"><strong>STEP 1<\/strong>:<\/span>\u00a0Our sample data consists of Months and multiple Sales values for each quarter. \u00a0Let us say we want a\u00a0<strong>column that counts from 1\u00a0to 12\u00a0<\/strong>next to our data to serve as our row numbers.<\/p>\n<p>(Make sure that your data is firstly converted into an <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/how-to-insert-an-excel-table\/\" target=\"_blank\" rel=\"noopener noreferrer\">Excel Table<\/a> by pressing CTRL+T and OK).<\/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\/2016\/10\/Index-Columns-01.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Create Index Columns Using Power Query\"  class=\"alignnone size-full wp-image-4936\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/10\/Index-Columns-01.png\" alt=\"Create Index Columns Using Power Query\" width=\"528\" height=\"535\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/10\/Index-Columns-01.png 528w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/10\/Index-Columns-01-296x300.png 296w\" sizes=\"(max-width: 528px) 100vw, 528px\" \/><\/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>Within here you need to select <strong><em>Add Column &gt;\u00a0Add Index Column &gt; Custom<\/em><\/strong><\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/10\/Index-Columns-02.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Create Index Columns Using Power Query\"  class=\"alignnone size-full wp-image-4937\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/10\/Index-Columns-02.png\" alt=\"Create Index Columns Using Power Query\" width=\"520\" height=\"432\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/10\/Index-Columns-02.png 520w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/10\/Index-Columns-02-300x249.png 300w\" sizes=\"(max-width: 520px) 100vw, 520px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 3:<\/span>\u00a0<\/strong>This brings up the <strong>Index\u00a0Column<\/strong> dialogue box.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-03.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Create Index Columns Using Power Query\"  class=\"alignnone size-full wp-image-5154\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-03.png\" alt=\"Create Index Columns Using Power Query\" width=\"699\" height=\"261\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-03.png 699w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-03-300x112.png 300w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/a><\/p>\n<p>Set the\u00a0<strong>Starting Index\u00a0<\/strong>into 1, this would mean the starting number will be 1.<\/p>\n<p>For the\u00a0<strong>Increment,\u00a0<\/strong>place in 1. This means that every succeeding number will be incremented by one. So we will have 1, 2, 3, 4\u00a0and so on..<\/p>\n<p>Click\u00a0<strong>OK.<\/strong><\/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;\">Now you will see your changes take place and the data now has an\u00a0<strong>index column<\/strong><strong>!<\/strong><\/span><\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-04.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Create Index Columns Using Power Query\"  class=\"alignnone size-full wp-image-5155\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-04.png\" alt=\"Create Index Columns Using Power Query\" width=\"366\" height=\"287\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-04.png 366w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-04-300x235.png 300w\" sizes=\"(max-width: 366px) 100vw, 366px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>STEP 5: <\/strong><\/span>Click <strong>Close &amp; Load<\/strong> from the <strong>Home<\/strong> tab and this will automatically open up a brand new worksheet in your Excel workbook with the new\u00a0data.<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-05.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Create Index Columns Using Power Query\"  class=\"alignnone size-full wp-image-5156\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-05.png\" alt=\"Create Index Columns Using Power Query\" width=\"446\" height=\"145\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-05.png 446w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-05-300x98.png 300w\" sizes=\"(max-width: 446px) 100vw, 446px\" \/><\/a><\/p>\n<p>You now have your new table with your index column!<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-06.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"Create Index Columns Using Power Query\"  class=\"alignnone size-full wp-image-5157\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-06.png\" alt=\"Create Index Columns Using Power Query\" width=\"402\" height=\"489\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-06.png 402w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/11\/Index-Columns-06-247x300.png 247w\" sizes=\"(max-width: 402px) 100vw, 402px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline; color: #0000ff;\"><strong>HELPFUL RESOURCE:<\/strong><\/span><\/p>\n<p><a href=\"http:\/\/myexcelonline.thinkific.com\/courses\/the-ultimate-excel-power-query-data-cleansing-online-course\" target=\"_blank\" rel=\"noopener noreferrer nofollow\"><img loading=\"lazy\" decoding=\"async\" title=\"Create Pivot Columns Using Power Query\"  class=\"alignnone wp-image-4477 size-full\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/380x230.jpg\" alt=\"Create Pivot Columns Using Power Query\" width=\"380\" height=\"230\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/380x230.jpg 380w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2016\/09\/380x230-300x182.jpg 300w\" sizes=\"(max-width: 380px) 100vw, 380px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Power Query lets you perform a series of steps to transform your Excel data. One of the most common steps I do, is I want to\u00a0add an index column that serves as a row counter\u00a0of my data. There is the alternative method of using the ROW formula in Excel. However if we simply want to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":17271,"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":[190,195,117],"acf":[],"_links":{"self":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/4933"}],"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=4933"}],"version-history":[{"count":0,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/4933\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media\/17271"}],"wp:attachment":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media?parent=4933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/categories?post=4933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/tags?post=4933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}