Cleaning Data Smart Way

dimer

New Member
Joined
Dec 7, 2011
Messages
12
Hi Everyone,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
I am trying to create a script that will clean data in the table using a specific way.
<o:p></o:p>
Here is the file with the original data and the results:<o:p></o:p>
http://www.box.com/s/64907aed4d2371cc33e5
<o:p></o:p>
Basically script should go through the Code 1 column comparing codes, if the code matches then it looks into Code 2 column and do some changes, if required, to Code 2 column only. Changes are based on some rules.<o:p></o:p>

Rule 1, if values are alike in Code 2 column (matching 4 letters or more), and all lines have the same date then overwrite all values with the longest value.<o:p></o:p>

Rule 2, if values are alike in Code 2 column (matching 4 letters or more), But lines have different date then overwrite all values with the longest value of the oldest date.<o:p></o:p>

Hope it explains the problem, and if not, please, ask me questions.<o:p></o:p>

I do not even know how to start? Sorting data is okay, so I would first sort data by Code 1 column then, read each unique value in the Code 1 column into temporary array. And then what? <?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape style="WIDTH: 12pt; HEIGHT: 15.75pt; VISIBILITY: visible; mso-wrap-style: square" id=Picture_x0020_1 alt="0" type="#_x0000_t75" o:spid="_x0000_i1025"><v:imagedata o:title="0" src="file:///C:\Users\dpavlov\AppData\Local\Temp\msohtmlclip1\01\clip_image001.gif"></v:imagedata></v:shape>
<o:p></o:p>

Please, give ANY suggestions. <o:p></o:p>
<o:p> </o:p>
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,215,604
Messages
6,125,792
Members
449,260
Latest member
Mrw1

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