How to VLOOKUP From Another Excel Sheet In Excel Power Query ? ( Merge Queries )

How to VLOOKUP From Another Excel Sheet In Excel Power Query

In this article I am going to tell you how to VLOOKUP in Excel Power Query ? If you have not heard about power query , don’t worry. In this article you will take a look at -

  • Import data from another excel sheet.
  • Import data in excel power query .
  • Transform data in Excel power query .

So lets start ,
We have two excel sheets, one is the Sales Report and the second one is the Region Map.

There are two columns in the Region Map - State and Region. We have a State column in the Sales Report .

So we want to lookup region of the state from the region map sheet .

Creating and Opening New Excel Sheet

To create a new worksheet right click on mouse and go to New > Microsoft Excel Worksheet. Give it a name whatever you want . Now open the Excel Sheet .

Creatin New Excel Worksheet

Importing Another Workbook In Microsoft Power Query

After opening the newly created excel sheet now we are going to import our both excel sheets in this excel file or Power Query.

To Import these excel files in power query follow these steps -:

  1. First of all click on the DATA tab from the top of the excel sheet.
  2. Now click on New Query > From File > From Workbook . This will open file explorer to select the excel workbook for import.
  3. Importing Data From Excel Workbook
  4. Now we have two files to import . We have to select a single file at once. We select the Sales Report and click on Import.
  5. Sales Report Select
  6. Now a Navigator tab will open . In this tab first we have to select the sheet name and after that click on Transform Data .
  7. Power Query Navigator
  8. After completing previous step our data will open in Microsoft Power Query Editor. Now we have to import the Region Map sheet within the Power Query.
  9. To import the region map sheet click on New Source > File > Excel , within the Home tab .
  10. Importing New File In Power Query
  11. Now select the sheet and click on import. Now in navigator tab click on sheet name and click on OK.
  12. Power Query Navigator1
  13. Now both sheets have opened in Microsoft Power Query Editor. We can view both sheets in the left pane named Queries within the Power Query Editor.

VLOOKUP In Power Query Editor ( Merge Queries )

Now we VLOOKUP which state falls in which region ? In Power Query this function is called Merge Queries.

Follow these steps to VLOOKUP the region of state from region map sheet -:

  1. Very first select the sheet which has the vlookup value . Here I want to vlookup state name in the orders data sheet .So I have selected the Orders Data Sheet.
  2. Now click on Merge Queries within the Home tab.
  3. Merge Queries In Microsoft Power Query
  4. A merge tab will open . Select the column which one you want to VLOOKUP.Now select the Region Map sheet from here we want to vlookup . Now select the State column (matching column) from the region map .
  5. In the Join Kind dropdown select Left Outer (all from first , matching from second).
  6. If there is no error you see a green right symbol and select the OK.
  7. Merge Queries Tab
  8. Now a region map expandable column added in Order Data Sheet.
  9. Click On expand icon from top right of region map column.
  10. Merged Region Map
  11. Now a filter UI will open , select the region field and click on OK.
  12. Expand Merged Queries
  13. Now a Region Map. Region Column added to our sheet with vlookup region . You can simply move your column by holding and dragging it.
  14. Now click on Close and Load from top left . Now our data is loaded in Excel Sheets with a region map column.
  15. Close and Load Data In Excel

In future if you have added more data or edited your sales report . Then you don't need to do these steps again . Simply refresh the data in Excel Sheet and you data have been updated with new data.

No comments:

Post a Comment