Link to home
Start Free TrialLog in
Avatar of Nirvana
NirvanaFlag for India

asked on

extract zip code or specific digits from text address

I have address where I need to extract zip code How can i do that with excel formula. I need to extract last four digits from text and number string . attached is the sample file. I have tried the below formula

MID(TRIM(A1),FIND(CHAR(1),SUBSTITUTE(TRIM(A1)," ",CHAR(1),LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ",""))))-4,4) but i might have many spaces
sample.xlsx
Avatar of Shums Faruk
Shums Faruk
Flag of India image

Try below:
=LOOKUP(9.99999999999999E+307,--MID(A2,ROW(INDIRECT("1:"&LEN(A2))),6))

Open in new window

Please find attached...
sample_v2.xlsx
Avatar of Rgonzo1971
Rgonzo1971

@Shums at line 35, 131, etc wrong result
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You are right Rgonzo Sir :(
Perfect Rgonzo Sir :)
Avatar of Nirvana

ASKER

Brilliant