i have list of address of customers which may or maynot contains zip code.
eg:" C/O Ridhi Sidhi(Ganesham), 10 11, Basement Shardul Market, In Front Of Sbbj Bank, DT Jhunjhunu, PIN 333001
" ..... i want a formula to extract 6 digit zipcode wherever it is in the address field
it should extract just 6 digit number from all zip code
thanks in advance for your help
sailesh9630,
If, like in your example, the zip code is always the last 6 characters of the address, you can use the following formula (assumes you have a header and the addresses start in A2:
=RIGHT(A2,6)*1
Then copy down.
Hope that helps,
~tigeravatar
its working great but there is an error sometimes....
like by mistake when in address its
eg: J 904, Reliance Township, Near Nandipark Society, Piplod, Dist Surat 395007.
after zip its fullstop .... its not working for it
please help me
Last edited by romperstomper; 06-17-2011 at 09:08 AM.
and its not compulsory that in data zip code is at end........
it may be in middle of address.....
if customers send address with error zip of 7 digit then it should not show any result
is there a possibility.
sailesh9630,
Can you post a sample workbook so we can get a better idea of how to help you?
~tigeravatar
sailesh9630,
Because of how your data is setup, I created an addin to introduce a new formula. Here is the link for the GETZIP_Formula addin.
Download the addin and save it in the following folder:
C:\Documents and Settings\%username%\Application Data\Microsoft\AddIns
Then enable the add-in in Excel 2007/2010 by clicking on the office button -> Excel Options -> Add-ins -> Go -> and check "GETZIP_Formula"
Then you will be able to type in cell D2:
=IF(GETZIP(C2)=0,"",GETZIP(C2))
and copy down.
That formula has the following function:
Public Function GETZIP(strAddress As String) As Double Dim AddressPart() As String: AddressPart = Split(strAddress, " ") Dim PartIndex As Long, SearchIndex As Long For PartIndex = 0 To UBound(AddressPart) If Len(AddressPart(PartIndex)) = 6 _ And IsNumeric(AddressPart(PartIndex)) Then GETZIP = AddressPart(PartIndex) Exit Function ElseIf Len(AddressPart(PartIndex)) > 6 Then For SearchIndex = 1 To Len(AddressPart(PartIndex)) If Not IsNumeric(Mid(AddressPart(PartIndex), SearchIndex, 1)) Then AddressPart(PartIndex) = Replace(AddressPart(PartIndex), Mid(AddressPart(PartIndex), SearchIndex, 1), vbNullString) End If Next SearchIndex If Len(AddressPart(PartIndex)) = 6 _ And IsNumeric(AddressPart(PartIndex)) Then GETZIP = AddressPart(PartIndex) Exit Function End If End If Next PartIndex End Function
Hope that helps,
~tigeravatar
thank your for your time and help... but i am unable to understand...... can you give your chat is so i can understand better...............please help me
Last edited by romperstomper; 06-17-2011 at 07:53 AM. Reason: remove unnecessary quote
maybe this:
=LOOKUP(99^99,--MID(RIGHT(C2,15),MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},RIGHT(C2,15)&"0123456789")),ROW($A$1:$A$10)))
"Relax. What is mind? No matter. What is matter? Never mind!"
can you give your chat id so i need your help
Last edited by romperstomper; 06-17-2011 at 07:53 AM. Reason: remove quote
You can just write here. More people see it better help you'll get![]()
"Relax. What is mind? No matter. What is matter? Never mind!"
its working but when text is
eg: pin 123434 VILLAGE+Post.Ahari, Dist.Jhajjar
is showing error
Last edited by romperstomper; 06-17-2011 at 07:54 AM.
Well, if I extend it you will get 1 from:
Mujeeb Pasha No 8,1St Floor Opp F,M Times Shop Someshwaranagar Jayanagr 1St Block Banglore:560011
I think you need macro that would extract all numbers and take biggest
"Relax. What is mind? No matter. What is matter? Never mind!"
if you are expert....
you can solve understand and solve my problems ill pay you for your work...
give me your chat id ....
what say ?
Last edited by romperstomper; 06-17-2011 at 07:54 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks