Currently I am working with a spreadsheet where I have to collect addresses of UK business Directors. Some of the directors have multiple addresses. UK zip code consist of two segment and I have to ignore the address where the first segment of zip code starts with W1 , SW1, EC1, EC2, EC3 & EC4 and ends with character not number because those are generally industrial address. For example Please check the following addresses where the addresses starts with W1 , SW1, EC1, EC2, EC3 & EC4 and ends with letter and I have to ignore collecting those.
3RD FLOOR 207 REGENT STREET, LONDON, W1B 3HH
42, CHARTERHOUSE SQUARE, LONDON EC1, EC1M 6EU
5, WESTMINSTER GARDENS, LONDON, MARSHAM STREET, SW1P 4JA
160, QUEEN VICTORIA STREET, LONDON, EC4V 4QQ
THE BROADGATE TOWER 20, PRIMROSE STREET, LONDON, EC2A 2RS
BAKERS' HALL 9, HARP LANE, LONDON, EC3R 6DP
Also please take note the zip codes of W11,W12 W13 and so on are not prohibited and same thing applies for the SW1, EC1, EC2, EC3 & EC4.
Now as we are working on the bulk data, its impossible to notice the zip codes when collecting the address. So I have tried with combination of various formula to highlight the first segment of those mentioned zip codes in a separate column using just right after pasting the address. In this way I can see the prohibited zip codes right after pasting the address. Although I am not successful cracking on it but I was close of it. I am just sharing the thing I have tried and looking for a compact solution from you guys.
First of I have created a separate column E where it will show the first segment of the zip code when I will paste the addresses in the column D. Here is the code which I have used:
=TRIM(LEFT(RIGHT(" "&SUBSTITUTE(TRIM(D2)," ",REPT(" ",60)),120),60))
Next I have tried to show only those values which starts with W1 , SW1, EC1, EC2, EC3 & EC4 and ends with a letter. So I have created another column F and create the formula for "SW1"
=IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), IF(ISNUMBER(SEARCH("SW1",E2)), LEFT(E2,3), ""),"")
So if I have to check for W1 , EC1, EC2, EC3 & EC4, I have to create 5 more columns with the same formula where just have to change the value of search function. This lead me to 6 extra columns and I want a compact formula for savings the space because I generally split the browser and execl in a way that's why I can copy and paste data on the spreadsheet without minimizing the spreadsheet. This saves me a lots of time. But creating six more column will make my work more time consuming as I have to check all six columns for those zip codes.
Question - 1:
I want to ask, is there any way to make a compact formula for showing my desired result in a single column only?
Question - 2:
We also have to ignore the addresses which consist the words "floor","house" & "airport". I have tried the below formula for single query:
=IF(ISNUMBER(SEARCH("Floor",D2)), "Floor", "")
Is there any possibilities combing all required formula and show the result in one column?
Update regarding Question - 1:
I have tried to combine using some other formula to show the required result. But comes up with showing only those zip code which starts with W1 , SW1, EC1, EC2, EC3 & EC4 but can't modify it to restrict those results also where the last character is a number. Here is the code:
=IF(ISNUMBER(FIND("W1",(LEFT(E2,2)),1))=TRUE,LEFT(E2,2)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),IF(ISNUMBER(FIND("SW1",E2,1))=TRUE,LEFT(E2,3)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),IF(ISNUMBER(FIND("EC1",E2,1))=TRUE,LEFT(E2,3)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),IF(ISNUMBER(FIND("EC2",E2,1))=TRUE,LEFT(E2,3)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),IF(ISNUMBER(FIND("EC3",E2,1))=TRUE,LEFT(E2,3)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),IF(ISNUMBER(FIND("EC4",E2,1))=TRUE,LEFT(E2,3)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),""))))))
Your formula in column E could combine the last character is not a number with the parse of the first section of the postal code with something like the following.
=IF(ISERROR(--RIGHT(A2)), TRIM(LEFT(TRIM(RIGHT(A2, 8)), 4)), "")
That makes the parsing dependent on a British postal code being either 7 or 8 characters wide with the first section being either 3 or 4 characters. The 'wandering' space is either picked up and trimmed off or not picked up at all depending on the length.
With column Y listing the prefixes of the postal codes to be ignored and column Z (in any worksheet) devoted to a cross-reference list of exceptions like the following:
Note that each of the entries in the Ignore list and the Exceptions list all carry the wildcard asterisk as a suffix. This is necessary to deal with staggered lengths of the comparisons to be made.
The formula used for a Conditional Formatting Rule for A2:E999 would be,
=AND(SUMPRODUCT(COUNTIF($E2, $Y$2:$Y$7)), NOT(SUMPRODUCT(COUNTIF($C2, $Z$2:$Z$4))))
This resolves TRUE for any postal that should be ignored and is not in the exception list.
The cross-reference tables of ignores and exceptions may benefit from becoming a named range for easy reference. You could use a dynamic range definition for the Applies to: of something like:
=Sheet1!$Y$2:INDEX(Sheet1!$Y:$Y, MATCH("zzz", Sheet1!$Y:$Y))
=Sheet1!$Z$2:INDEX(Sheet1!$Z:$Z, MATCH("zzz", Sheet1!$Z:$Z))
Here's a formula to tell you whether the first word after the last comma ends with a number.
=ISNUMBER(NUMBERVALUE(RIGHT(LEFT(TRIM(RIGHT(SUBSTITUTE(B1,",",REPT(" ",LEN(B1))),LEN(B1))),SEARCH(" ",TRIM(RIGHT(SUBSTITUTE(B1,",",REPT(" ",LEN(B1))),LEN(B1))))-1))))
I have two lists of street addresses that have a combination of street numbers and names in one cell. One list is a key, if you will, of how the addresses are labeled in our company, and the other list is all of the addresses that customers used to get a package to us. For example![Address Key][1]
is the correct address format. The other list has errors within the address because there may be errors with order, fat fingered street numbers, or spelling errors of the street names. I'd like to create a formula or find a way that looks for any portion of the second list, and have it return a "yes" or "no" if it is an address in the address key. The second list that I need to lookup with is below.![enter image description here][2]
You can see that the addresses that the customers enter do not match how we label our addresses. Hopefully there is a way for me to look up any part of the address that they entered against our key, and have it return a value that is associated with each address in the key. For example, the first address is location 100. Even though the customer list doesn't have that address entered correctly, i'm hopping it can find a part of the address they entered in our list.
Thanks,
Jay
You can try using a Vlookup with a 'TRUE' parameter in the RangeLookup argument. That way the Vlookup will return an approximate match against your company list. You may need to reformat the data a bit (e.g. concatenate house number and street name together) and do some iterations to get the final result that you need. You haven't added any screen shots so I can't see the exact format of your data.
I have 2002 addresses which have all been compiled into a single cell during the download process from my server; in most cases, the hash (#) symbol is used to separate fields (such as Line 1, Line 2, City, Postcode).
I have spent a lot of time trying combinations of LEFT, MID and other functions, but to no avail; the problem is that as there are so many addresses, and not all of them have the same number of characters for each field (such as Postcode - some will have 6 characters (including blank space), where some others will have five or more/fewer), there doesn't appear to be a one-size-fits-all solution that I can enter once and then use Excel's auto-fill handle/feature to complete the process for all records.
Here is a sample of my data (which has been anonymised):
44A THE ADDRESS#EALING#LONDON#W1 1WW#
541 PARSON PLACE#HENDON#LONDON#NW4 4WN#
SOMEBODY PRACTICE CHALKHILL PCC THE WELFORD CTR#11B CHALKHILL AVENUE#WIMBLEDONE MIDDX#HH9 9HH#
THE SEBELMONT MEDICAL CLINIC 18 EASTERN ROAD#SOUTHALL#MIDDLESEX#UN1 1NU#
130 FINGOVER COURT#REDBUS STREET#CAMBERWELL#SE5 5ES#
KING'S ELBOW MEDICAL CENTRE 17F STAGLAND LANE#KINGSBURY#MIDDX#NW9 9WN#
10 LADYFOOT ROAD RUISLIP#MIDDLESEX#HA4 4AH#
I want to be able to extract everything between the hash symbols (excluding/omitting the hash symbols themselves) and I am dedicating four columns to store this data: Address Line 1, AL2, AL3, Postcode.
Going by the first example (44A THE ADDRESS#EALING#LONDON#W1 1WW#) which resides in a single cell, I hope to achieve something like the following outcome:
AL1 AL2 AL3 POSTCODE
44A THE ADDRESS EALING LONDON W1 1WW
It doesn't matter if some of the address sections appear under the wrong column - I can very easily rectify this and can even add another column; I simply want to be able to extract the data from the single cell.
If you import the data as a text file, you can normally select the delimiter.
File->open
<select the file from the dialogue box>
This dialogue box should appear, after clicking next, it will appear as above, at which point, you can select a hash as a delimiter- instant self data sorting!
I have a list of addresses which are individual strings in an Excel spreadsheet:
123 Sesame St New York, NY 00000
123 Sesame Ct Atlanta, GA 11111
100 Sesame Way, 400 Jacksonville, FL 22222
As you can see above the third address is different. It has a suite number of 400 on what would normally be the street line 2 line. I am having trouble coming up with a formula that will parse the addresses above into its individual cells: Street 1 (with street 2 or suite information in this line), City, State and Zip.
My thought is to start from the right and extract information based on a space delimiter, but I am not sure how to do this. How would I go about this?
I guess you can do a combination of MID & FIND to extract parts of the address,
e.g.
=IF(IFERROR(MID(A1,1,FIND(",",A1,FIND(",",A1)+1)),1)=1,MID(A1, 1, FIND(",",A1)-1),MID(A1,1,FIND(",",A1,FIND(",",A1)+1)-1))
will extract the address from cell A1, depending of the number of commas it finds (1 or > 1).
ZIP and state won't be too difficult following the above mentioned pattern. I think the problem is extracting the city as you don't know where to set the limit between the city name and the street unless you have a finite set of street types, e.g. ct, st, way etc.
You can use a slightly shorter formula using SUBSTITUTE() and LEN() in addition to FIND() and LEFT():
=LEFT(A1,FIND("#",SUBSTITUTE(A1,",","#",LEN(A1)-LEN(SUBSTITUTE(A1,",",""))))-1)
The first part which gets executed is:
LEN(A1)-LEN(SUBSTITUTE(A1,",",""))
Which basically calculates the number of commas in the input string. This then goes into the next formula:
SUBSTITUTE(A1,",","#",[1])
Which substitutes the last occurrence of comma by # (if addresses have this, use another character which you won't find in the address).
=LEFT(A1,FIND("#",[2])-1)
And the last part is takes the characters up to the # we just inserted.