{"id":21969,"date":"2020-02-21T12:37:05","date_gmt":"2020-02-21T17:37:05","guid":{"rendered":"https:\/\/breakingintowallstreet.com\/biws\/?post_type=biws_kb&#038;p=21969"},"modified":"2024-08-14T06:37:41","modified_gmt":"2024-08-14T11:37:41","slug":"excel-power-query","status":"publish","type":"biws_kb","link":"https:\/\/breakingintowallstreet.com\/kb\/excel\/excel-power-query\/","title":{"rendered":"Excel Power Query: Full Explanation and Examples [Tutorial Video] (11:03)"},"content":{"rendered":"<p><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-flat ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Excel Power Query: Full Explanation and Examples<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/breakingintowallstreet.com\/kb\/excel\/excel-power-query\/#The_Short_Answer_About_More_Advanced_Excel_Features\">The Short Answer About More Advanced Excel Features<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/breakingintowallstreet.com\/kb\/excel\/excel-power-query\/#Excel_Power_Query_Demonstration\">Excel Power Query Demonstration<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/breakingintowallstreet.com\/kb\/excel\/excel-power-query\/#Excel_Power_Query_Other_Use_Cases\">Excel Power Query: Other Use Cases<\/a><\/li><\/ul><\/nav><\/div>\n<br \/>\nOne common question we get is: \u201cI see you now cover Excel features like Power Pivot, <strong>Power Query<\/strong>, VBA, and the Internal Data Model in Excel. Do I need to know these features?\u201d<\/p>\n<p>\u201cWill I be tested on them in interviews? How could they possibly be useful for deal-based roles like IB or PE?\u201d<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_Short_Answer_About_More_Advanced_Excel_Features\"><\/span><strong>The Short Answer About More Advanced Excel Features<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <strong>short answer<\/strong> is that you don\u2019t \u201cneed\u201d to know these features for interviews, but they can make your life on the job much easier.<\/p>\n<p>Even with basic knowledge gained from a few minutes spent using these tools, you can save yourself hours and hours of time.<\/p>\n<p>Yes, you usually work with financial models and valuations in investment banking, private equity, and related fields, but you also have to <strong>analyze data<\/strong> and present it effectively.<\/p>\n<p><strong>Power Query<\/strong> is hugely helpful here because it can automatically parse websites, extract data, and put it in tabular format, so that you do not have to copy and paste anything manually or clean the data manually.<\/p>\n<p>Also, if the website or source data ever changes, Power Query lets you refresh it automatically and make the changes flow through your model.<\/p>\n<style>.enteremail__large--inline{margin:60px auto!important}<\/style>\n<h2><span class=\"ez-toc-section\" id=\"Excel_Power_Query_Demonstration\"><\/span><strong>Excel Power Query Demonstration<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The other day, I had to look up and classify a company\u2019s sales transactions by state.<\/p>\n<p>I had the abbreviations for each state or territory, but I needed to find their full names\u2026 and they were inconsistent.<\/p>\n<p>Also, there were some non-standard\/less-common ones, such as \u201cMP\u201d for the Northern Mariana Islands, \u201cAP\u201d for U.S. Armed Forces \u2013 Pacific, etc:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21970\" src=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075543\/Excel-Power-Query-01.jpg\" alt=\"Excel - State Abbreviations\" width=\"917\" height=\"473\" srcset=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075543\/Excel-Power-Query-01.jpg 917w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075543\/Excel-Power-Query-01-300x155.jpg 300w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075543\/Excel-Power-Query-01-768x396.jpg 768w\" sizes=\"(max-width: 917px) 100vw, 917px\" \/><\/p>\n<p>I could have Googled it and copied and pasted and tweaked the data, but instead I used <strong>Power Query<\/strong> to do this.<\/p>\n<p><strong>One warning:<\/strong> Power Query won\u2019t work in Mac Excel. You need a fairly modern version of PC\/Windows Excel (2016, 2019, or Office 365) to follow this example; otherwise, you can download Power Query as an add-in for older versions (Google &#8220;Power Query&#8221; and your version of Excel).<\/p>\n<div class='code-block code-block-4' style='margin: 8px 0; clear: both;'>\n<div class=\"kb-adinsert-modal\">\n    <div class=\"kb-adinsert-top\">\n      <div class=\"media\">\n          <img decoding=\"async\" class=\"alignnone size-full wp-image-28448\" src=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2024\/05\/07054849\/Excel-VBA-Ico.png\" alt=\"Excel & VBA\" width=\"128\" height=\"128\" \/>\n      <\/div>\n      <div class=\"content\">\n          <h3>Learn Excel Shortcuts, Formulas, Graphs, Data, and VBA for Automation<\/h3>\n      <\/div>\n    <\/div>\n    \n    <div class=\"full_text\">\n    \t<ul>\n        \t<li>\n            \t<h4>Become a shortcut, formula & formatting machine<\/h4>\n              <p>Excel will be your \u201cnative language\u201d after you finish this course<\/p>\n\t\t\t    <\/li>\n          <li>\n          \t<h4>Learn the skills with dozens of practice exercises<\/h4>\n            <p>Learn by doing and check your work against the solutions<\/p>\n\t\t\t    <\/li>\n          <li>\n          \t<h4>Shave hours off your workday with VBA and macros<\/h4>\n            <p>Automate repetitive tasks, format spreadsheets quickly, and more\n\n<\/p>\n\t\t\t  <\/li>\n      <\/ul>\n        \n      <a class=\"cta-link orange-button-medium\" href=\"https:\/\/breakingintowallstreet.com\/excel-vba\/\" target=\"_blank\">Full Details<\/a>\n      \n      <a class=\"cta-link orange-button-medium bg-blue\" href=\"https:\/\/biws-support.s3.us-east-1.amazonaws.com\/Course-Outlines\/Excel-VBA-Course-Outline.pdf\" target=\"_blank\" rel=\"noopener\">Short Outline<\/a>\n    <\/div>\n<\/div>\n<\/div>\n\n<p><strong>Step 1:<\/strong> Go to Data, Get Data, From Other Sources, and From Web in Excel and enter the URL you want to use. In this case, we want to use this list of state and territory abbreviations from Wikipedia:<\/p>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_U.S._state_abbreviations\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/en.wikipedia.org\/wiki\/List_of_U.S._state_abbreviations<\/a><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21971\" src=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075542\/Excel-Power-Query-02.jpg\" alt=\"Excel Power Query - Step 1\" width=\"522\" height=\"629\" srcset=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075542\/Excel-Power-Query-02.jpg 522w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075542\/Excel-Power-Query-02-249x300.jpg 249w\" sizes=\"(max-width: 522px) 100vw, 522px\" \/><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21972\" src=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075542\/Excel-Power-Query-03.jpg\" alt=\"Data URL in Power Query\" width=\"913\" height=\"344\" srcset=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075542\/Excel-Power-Query-03.jpg 913w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075542\/Excel-Power-Query-03-300x113.jpg 300w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075542\/Excel-Power-Query-03-768x289.jpg 768w\" sizes=\"(max-width: 913px) 100vw, 913px\" \/><\/p>\n<p><strong>Step 2:<\/strong> Click \u201cOK\u201d and then \u201cConnect\u201d and select the Table that you want to use:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21973\" src=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075541\/Excel-Power-Query-04.jpg\" alt=\"Excel Power Query - Step 2\" width=\"878\" height=\"698\" srcset=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075541\/Excel-Power-Query-04.jpg 878w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075541\/Excel-Power-Query-04-300x238.jpg 300w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075541\/Excel-Power-Query-04-768x611.jpg 768w\" sizes=\"(max-width: 878px) 100vw, 878px\" \/><\/p>\n<p><strong>Step 3:<\/strong> Go to \u201cTransform Data\u201d and delete the columns that you do not need (here, it&#8217;s based on the best matches for abbreviations and the only column that listed all the possible abbreviations).<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-21974\" src=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-05-1024x581.jpg\" alt=\"Excel Power Query - Step 3\" width=\"1024\" height=\"581\" srcset=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-05-1024x581.jpg 1024w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-05-300x170.jpg 300w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-05-768x436.jpg 768w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-05.jpg 1299w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><strong>Step 4:<\/strong> Now, press \u201cClose &amp; Load\u201d to import this data into a table on a new spreadsheet in your Excel file. At this point, you can also rename the table under Properties and &#8220;Name&#8221; on the right-hand side under &#8220;Query Settings&#8221;:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-21975\" src=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-06-1024x579.jpg\" alt=\"Excel Power Query - Step 6\" width=\"1024\" height=\"579\" srcset=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-06-1024x579.jpg 1024w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-06-300x170.jpg 300w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-06-768x435.jpg 768w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-06.jpg 1299w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21976\" src=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-07.jpg\" alt=\"Imported Data from Power Query\" width=\"413\" height=\"879\" srcset=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-07.jpg 413w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075540\/Excel-Power-Query-07-141x300.jpg 141w\" sizes=\"(max-width: 413px) 100vw, 413px\" \/><\/p>\n<p><strong>Step 5:<\/strong> Now, you can write an INDEX\/MATCH formula to retrieve the state\/territory name from the appropriate column. We use this one in the example:<\/p>\n<p>=INDEX(State_Table,MATCH(Txns_by_State!D5,State_Table[USPS],0),1)<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21977\" src=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075539\/Excel-Power-Query-08.jpg\" alt=\"INDEX\/MATCH with Power Query\" width=\"922\" height=\"405\" srcset=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075539\/Excel-Power-Query-08.jpg 922w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075539\/Excel-Power-Query-08-300x132.jpg 300w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075539\/Excel-Power-Query-08-768x337.jpg 768w\" sizes=\"(max-width: 922px) 100vw, 922px\" \/><\/p>\n<p><strong>Step 6:<\/strong> Copy and paste this formula down using the Ctrl + C and Alt, E, S, F shortcuts:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21978\" src=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075539\/Excel-Power-Query-09.jpg\" alt=\"Finished List of Transactions by State\" width=\"928\" height=\"627\" srcset=\"https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075539\/Excel-Power-Query-09.jpg 928w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075539\/Excel-Power-Query-09-300x203.jpg 300w, https:\/\/biwsuploads-assest.s3.amazonaws.com\/biws\/wp-content\/uploads\/2020\/02\/19075539\/Excel-Power-Query-09-768x519.jpg 768w\" sizes=\"(max-width: 928px) 100vw, 928px\" \/><\/p>\n<p>If the data is really messy, we could have also rearranged the table so that each row contained the state\u2019s full name and one possible abbreviation for it, then the next row contained the next possible abbreviation for it, and so on.<\/p>\n<p>And if something ever changes, we could easily refresh this data automatically and keep the transformations in place now.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Excel_Power_Query_Other_Use_Cases\"><\/span><strong>Excel Power Query: Other Use Cases<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You could use this same feature to update data sheets for items such as:<\/p>\n<p>-Employees by location.<\/p>\n<p>-Buildings by location.<\/p>\n<p>-Employees by product line or geography.<\/p>\n<p>-Revenue or Net Income by product or geography.<\/p>\n<p>These are all common items in management presentations, memos, the <a href=\"https:\/\/www.mergersandinquisitions.com\/confidential-information-memorandum\/\" target=\"_blank\" rel=\"noopener noreferrer\">Confidential Information Memorandum (CIM)<\/a>, and other documents that you use or create all the time in investment banking and private equity.<\/p>\n<p>All you have to do is enter the Investor Relations section of the company&#8217;s website, find the right URL, and let Power Query parse all the text on the page and turn it into usable tables.<\/p>\n<p>This feature is arguably even more useful in corporate finance \/ budgeting roles where you may need to retrieve data from online sources and link it to Excel, and you don&#8217;t want to bother with manual copy-and-paste commands.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you\u2019ll learn how to use Power Query in Excel to retrieve data from online sources without having to copy and paste text and clean it up manually \u2013 and you\u2019ll see how it might be useful when creating presentations and other documents.<\/p>\n","protected":false},"featured_media":0,"template":"","class_list":["post-21969","biws_kb","type-biws_kb","status-publish","hentry","kb_category-excel"],"acf":[],"_links":{"self":[{"href":"https:\/\/breakingintowallstreet.com\/wp-json\/wp\/v2\/biws_kb\/21969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/breakingintowallstreet.com\/wp-json\/wp\/v2\/biws_kb"}],"about":[{"href":"https:\/\/breakingintowallstreet.com\/wp-json\/wp\/v2\/types\/biws_kb"}],"wp:attachment":[{"href":"https:\/\/breakingintowallstreet.com\/wp-json\/wp\/v2\/media?parent=21969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}