Solved

How to remove a word from a column of cells

Posted on 2011-09-18
2
200 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:
Ingeborg Hawighorst 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

813 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

16 Experts available now in Live!

Get 1:1 Help Now