Function Problems

How to Automatically Return a Phone Number from a County Lookup in Excel

Muhammad TalhaMuhammad Talha Nov 2, 2026 869 views

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.

How to Automatically Return Phone Numbers Based on County in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Create your master lookup table

On a separate sheet (for example, 'Sheet1'), type your county names in Column A and the corresponding phone numbers in Column B.

2
Select the destination cell

Click on the cell in your main sheet where you want the phone number to automatically appear after typing the county name.

3
Enter the VLOOKUP formula

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.

4
Apply and test

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 VLOOKUP Function
Exact Matches: Setting the last argument to 'FALSE' guarantees that Excel will only return a phone number if the entered county name is an exact match to the list, preventing incorrect data retrieval.
Data Lookups in WPS Spreadsheet

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. 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook containing the county data.
  2. 2. Use the Insert Function tool: Navigate to the 'Formulas' tab and click on 'Insert Function'.
  3. 3. Select VLOOKUP: Search for 'VLOOKUP' and let the intuitive dialog box help you select your lookup value, table array, and column index.
  4. 4. Auto-populate your data: Click 'OK'. The phone numbers will instantly populate based on the county inputs.
100% format compatibility with Microsoft Excel (.xlsx, .xls) and standard Excel formulas.Built-in function dialog box guides you step-by-step to construct lookup formulas without memorizing syntax.Lightweight architecture ensuring fast calculations even with massive lookup tables.
microsoft office alternative - wps office

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.