Excel Formula to Look Up an SSN from Another Worksheet
Question details
Find the SSN associated with a name or member ID on another worksheet and return a blank when there is no match.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains names or member IDs, while a second worksheet contains the matching identifiers and SSNs.
- Observed behavior
- A lookup formula should return the corresponding SSN for each matching name or member ID, or a blank if no match exists.
Check which columns contain the matching names or member IDs and SSNs on the source sheet. Ensure matching IDs use consistent text or number formats, and store SSNs consistently so leading zeros are preserved.
Use VLOOKUP to Return an SSN from Another Worksheet
Use this method when the source sheet has names or member IDs in the first column of the lookup range and SSNs in the next column.
On the source worksheet, place the names or member IDs in column A and the corresponding SSNs in column B. This example calls the worksheet Second Sheet.
On the destination worksheet, select the cell where you want the SSN for the identifier in A2 and enter =IFERROR(VLOOKUP(A2,'Second Sheet'!A:B,2,FALSE),""). Replace Second Sheet with the actual worksheet name.
Press Enter, then drag the cell's fill handle down to apply the formula to the remaining rows.

Use XLOOKUP to Match an Identifier and Return an SSN
Use XLOOKUP if your Excel version supports it and you want to specify the lookup and return columns separately.
Look Up SSNs Across Worksheets in WPS Spreadsheets
Use a VLOOKUP formula in WPS Spreadsheets to match a name or member ID with an SSN on another worksheet and display a blank for errors.
- 1. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
- 2. Check the source sheet: On the source worksheet, check that column A contains the matching names or member IDs and column B contains the SSNs.
- 3. Enter VLOOKUP: On the destination sheet, select the result cell for A2 and enter =IFERROR(VLOOKUP(A2,'Second Sheet'!A:B,2,FALSE),""). Replace Second Sheet with your source worksheet's name.
- 4. Apply the formula: Press Enter and drag the fill handle down to look up the remaining rows.

Frequently Asked Questions
Why does my lookup return a blank for an existing member ID?
Check that the ID in A2 and the source column use the same text or number format and do not contain extra spaces. With IFERROR, other formula errors also appear blank; temporarily remove IFERROR to see the underlying error.
What if the worksheet name contains spaces?
Enclose the worksheet name in single quotation marks in the formula, as in 'Second Sheet'!A:B. Replace Second Sheet with your actual sheet name.
Can VLOOKUP return an SSN from a column to the left of the ID?
No. VLOOKUP searches the first column of its selected range and returns a value to its right. Rearrange the columns or use XLOOKUP, which lets you select lookup and return columns independently.
What happens if two rows have the same name or member ID?
The formulas shown return the first matching row. Use a unique member ID where possible and check the source worksheet for duplicates.
How can I keep leading zeros in SSNs?
Store SSNs consistently as text on the source sheet, including any leading zeros. If they are stored as numbers, use an appropriate custom number format for display, but note that formatting alone does not change the stored value.




