Duplicate number deletion in a string

neveu

Board Regular
Joined
Jan 27, 2009
Messages
225
hello forum,
i have database with a string field that contains duplicates numbers.
what i would need to do is to search for each group of numbers - delimited by space character and search it through the other groups of numbers - also delimited by space and if the same group if found to delete the second and the thirs accourance etc and then move to the second group of numbers and do the same

for example if i have "19 21 19 21 19 21" then i would need to search for 19 and when i found 19 on the 3rd group to delete it and then continue the search until the last group;
the same with 21

the final result should be "19 21"


here is more data
Excel Workbook
E
2222 C
352
416
5
619 21 19 21
77
860
943
104
115
123 38 40
13115
145
152
16
171
1825
1931 31
2071
214
2231 A
23111
24
251
263
2711
2877
293
3061
IT Customers Data
Excel 2007
Cell Formulas
RangeFormula
E2=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D2,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D2&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E3=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D3,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D3&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E4=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D4,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D4&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E5=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D5,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D5&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E6=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D6,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D6&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E7=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D7,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D7&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E8=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D8,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D8&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E9=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D9,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D9&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E10=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D10,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D10&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E11=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D11,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D11&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E12=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D12,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D12&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E13=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D13,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D13&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E14=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D14,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D14&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E15=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D15,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D15&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E16=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D16,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D16&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E17=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D17,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D17&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E18=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D18,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D18&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E19=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D19,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D19&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E20=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D20,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D20&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E21=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D21,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D21&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E22=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D22,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D22&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E23=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D23,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D23&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E24=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D24,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D24&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E25=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D25,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D25&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E26=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D26,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D26&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E27=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D27,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D27&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E28=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D28,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D28&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E29=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D29,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D29&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
E30=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(D30,MIN(SEARCH({0;1;2;3;4;5;6;7;8;9},D30&"0123456789",1)),255),","," ")," "," "),"/"," "),"."," "),""," "))
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,224,527
Messages
6,179,351
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top