Extract Postal Code Prefixes in Excel When the Second Character Is a Number
Question details
Extract the letter prefix from a postal code when its second character may be a number.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains postal codes such as W8, W1, N1, or SW1, and the user needs the one- or two-letter prefix.
- Observed behavior
- The desired result is W for W8 and SW for SW1.
Check that each postal code starts with a letter and that its second character is either a letter or a digit. Remove leading spaces or other unexpected formatting before applying the formula.
Use a formula to extract the postal code prefix
Return the first character if the second is numeric; otherwise, return the first two characters.
With the postal code in cell A1, select an empty cell such as B1 and enter =LEFT(A1,2-ISNUMBER(--RIGHT(LEFT(A1,2)))).
Press Enter. A postal code beginning with W8 returns W, while one beginning with SW returns SW.
Select B1 and drag its fill handle down alongside the remaining postal codes.

Extract postal code prefixes in WPS Spreadsheet
Use the same LEFT and ISNUMBER formula in WPS Spreadsheet to extract one- or two-letter prefixes from postal codes.
- 1. Open the spreadsheet: Open WPS Spreadsheet and use Open to select your workbook.
- 2. Enter the formula: With a postal code in A1, select B1 and enter =LEFT(A1,2-ISNUMBER(--RIGHT(LEFT(A1,2)))).
- 3. Fill the column: Press Enter, then drag the fill handle from B1 down to the other rows.
- 4. Save the workbook: Choose File > Save or Save As and select an Excel-compatible format if needed.

Frequently Asked Questions
What does the formula return for W1 and N1?
When the postal code is in A1, =LEFT(A1,2-ISNUMBER(--RIGHT(LEFT(A1,2)))) returns W for W1 and N for N1.
Will the formula return both letters for SW1?
Yes. Because the second character is a letter, the formula returns the first two characters: SW.
How do I apply the formula to a whole column?
Enter the formula in B1 next to the first postal code in A1, then drag B1's fill handle down. The cell references adjust for each row.
Does this formula validate postal codes?
No. It extracts a prefix based on whether the second character is numeric. Check the source data separately for leading spaces, unusual formatting, and invalid postal codes.




