Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Formula to Remove Duplicate String Values In A Cell

Status
Not open for further replies.

kwtx04rm

Programmer
Sep 15, 2004
24
US
Can Excel formula evaluate the string in a cell (e.g. A2) to see if there are duplicates and delete them?

For instance...

A2 cell value is shown below (separated by spaces)
C10-98 ENH C10-98 ENH RAD C10-98 INT

Needs to be
C10-98 ENH RAD INT

Help if you can..thanks!
 
Tricky,

You will probably have to write a macro to go through the data parsing it. However, if the data is as fixed in format as your example suggests then the following formula in Column B would so the job.

Code:
=IF(MID(A2,1,6)=MID(A2,12,6),IF(MID(A2,1,6)=MID(A2,27,6),MID(A2,1,10)&" "&RIGHT(A2,3),A2),A2)

[navy]When I married "Miss Right" I didn't realise her first name was 'always'. LOL[/navy]
 



Hi,

The steps in the process are...

1. Data > Text to columns > Delimited (using SPACE)

2. Copy the row range

3. Paste Special -- TRANSFORM to a separate range

4. Advanced filter new range to get UNIQUE values

5. Copy the unique values

6. Paste special -- TRANSFORM next to original cell.

Turn on your macro recorder to record one cycle. Post back in forum707 to get advice & help customizing your macro.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Skip,

Your suggestion is an excellent alternative.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top