Solved

How to remove a word from a column of cells

Posted on 2011-09-18
2
199 Views
Last Modified: 2012-05-12
Hi all, I'm a bit new to the website, I had a quick look around existing answers and couldn't come across anything like this:

Basically, I'm trying to clean up addresses. In the addresses column, words such as "Suite", "level", "unit" etc recur. Those words do not necessarily start from the front of the cell and due to data entry errors, are not always separated by a space.

Is there a formula / function or a macro which can identify the words in the cells and automatically delete it from the cells?

Otherwise, happy with a response which can help me automatically delete the word but not detect instances where the word is not separated by a space.

Thanks!

0
Comment
Question by:Singamajig
2 Comments
 
LVL 16

Expert Comment

by:Carol Chisholm
ID: 36558332
You can use FIND(find_text, within_text, [start_num]), to find the start postion
FIND always counts each character, whether single-byte or double-byte, as 1, no matter what the default language setting is.

And REPLACE(old_text, start_num, num_chars, new_text) to change it.
 use "" to put nothing
0
 
LVL 50

Accepted Solution

by:
teylyn earned 500 total points
ID: 36558940
Hello,

can you provide a few samples of the source data and the desired output after processing with a formula or macro?  For example


ABC Suite 123, Devonport
Level 2 Domain Building, Northfolk
Parliament Building Level3
James House, Johnson Suite, Level 1
123 Some Street, Unit 2
Unit 4, 123 Some Street


If any mention of "suite", "level", or "unit" is removed, the result will be


ABC  123, Devonport
 2 Domain Building, Northfolk
Parliament Building 3
James House, Johnson ,  1
123 Some Street,  2
 4, 123 Some Street

That can be achieved with

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"Suite",""),"Level",""),"Unit","")

Is that what you need? If an address contains "Level 42", what do you want to remove? Just "Level" , or "Level 42"?

Please clarify your requirements. It would be most helpful if you could post a data sample with a dozen or so addresses "before" and "after" the procedure/formula is applied. The data sample should represent all the variations that you expect to see in your source data, so we know what to look out for.

cheers, teylyn
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now