Method 1 – Implement XLOOKUP Function
Steps:
- Below the primary data set, construct extra fields for implementing the above function’s formula.
- In cell D21, insert the following formula.
=XLOOKUP(B21,$B$5:$B$18,$F$5:$F$18,"Not Found")
- Press Enter and the formula will return the value from column F that matches the specific value of the lookup array of column B.
- To get the values for the lower cells as well, use AutoFill.
Method 2 – Employ VLOOKUP Function
Steps:
- In cell D21, type the following formula of the VLOOKUP function.
=VLOOKUP(B21,$B$5:$F$18,5,0)
- The formula will search for the value of cell B21 in the lookup array and will return a value that has an exact match with the lookup value from the fifth column of the table.
- Hit Enter and drag the Fill Handle to get the desired county name from the formula.
Method 3 – Use Data Selector Feature
Steps:
- Select the cell range B4:F18 and go to the Insert tab of the ribbon.
- From the Tables group, select Table.
- After checking if the cell range for creating the table is correct, press OK.
- Select the whole table and then, go to the Data tab of the ribbon.
- From the Data Types group, select Geography.
- You will see the Data Selector window pane, in which you can put your desired zip code for looking up the county.
- Input any desired zip code from the table, and you will see the corresponding county name as a result.
Things to Remember
- While selecting Data Selector, remember to select your required cell range otherwise, the feature will not show any result.
- In the formula of the VLOOKUP function, insert the correct lookup range and column index number to get the desired result.
- If any zip code starts with zero and Excel automatically omits it you can fix the problem by changing the cell format.
Download Practice Workbook
You can download the free Excel workbook here and practice on your own.
Related Articles
- How to Map Excel Data by ZIP Code
- Excel Formula to Change Zip Code to State
- How to Auto Populate Zip Codes in Excel
<< Go Back to Zip Code in Excel | Number Format | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!