How to Automatically Return a Phone Number from a County Lookup in Excel
Question details
The user wants to automatically retrieve a corresponding phone number when a specific county name (e.g., Milwaukee) is entered into an Excel cell.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Streamlining data entry by having Excel automatically match typed county names to a pre-defined list and display the associated contact numbers.
- Observed behavior
- The goal is to automatically display the correct phone number from a predefined list of multiple county and phone-number pairs exactly when a county is typed.
Ensure you have a master lookup table prepared in your workbook (e.g., on 'Sheet1') containing a complete list of unique county names in one column and their corresponding phone numbers in an adjacent column.
Use the VLOOKUP Function
VLOOKUP is the easiest and most common way to search for a specific value in the first column of a table and return a value in the same row from another column.
The VLOOKUP function requires four pieces of information: the value you want to look up, the range where the lookup value is located, the column number containing the return value, and whether you want an exact or approximate match.
On a separate sheet (for example, 'Sheet1'), type your county names in Column A and the corresponding phone numbers in Column B.
Click on the cell in your main sheet where you want the phone number to automatically appear after typing the county name.
Type the formula =VLOOKUP(A2, Sheet1!A:B, 2, FALSE) into the cell, assuming A2 is the cell where you will type the county name.
Press Enter. Type a county name like 'Milwaukee' into cell A2, and the corresponding phone number will auto-populate. Drag the fill handle down to apply this formula to the rest of your column.

Use the INDEX and MATCH Functions
INDEX and MATCH offer a more flexible alternative to VLOOKUP, which is highly beneficial if your lookup column (counties) is not the first column in your data range.
Easily Automate Phone Number Retrievals with WPS Office
WPS Spreadsheet fully supports advanced functions like VLOOKUP, INDEX/MATCH, and XLOOKUP, making data retrieval intuitive and fast. Use its powerful built-in function builder to avoid syntax errors and speed up your workflow.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook containing the county data.
- 2. Use the Insert Function tool: Navigate to the 'Formulas' tab and click on 'Insert Function'.
- 3. Select VLOOKUP: Search for 'VLOOKUP' and let the intuitive dialog box help you select your lookup value, table array, and column index.
- 4. Auto-populate your data: Click 'OK'. The phone numbers will instantly populate based on the county inputs.

Frequently Asked Questions
Why is my VLOOKUP returning an #N/A error?
The #N/A error means the formula cannot find the county name you entered. Ensure there are no spelling mistakes, hidden trailing spaces, or typos in either the lookup cell or the master lookup table.
Can I use XLOOKUP instead of VLOOKUP for this task?
Yes, if your version of Excel or WPS Spreadsheet supports XLOOKUP, it is a great alternative. You can simply use =XLOOKUP(A2, Sheet1!A:A, Sheet1!B:B) to return the phone number without counting column numbers.
What happens if a county name appears twice in my lookup table?
Both VLOOKUP and the standard INDEX/MATCH formula will stop searching and return the phone number associated with the very first matching instance they find from the top of your list.




