Three colunms data jumble

kcaenj

Board Regular
Joined
Oct 13, 2004
Messages
197
I have an access database where the last three columns are jumbled and I want to condense the data into two coherent columns. The example below shows what the data set looks like.

<table border=1>
<td>Colum A</td><td>Colum B</td><td>Colum C</td><tr>
<td>"NA"</td><td>emp1@test.com</td><td> </td><tr>
<td>OU=VPNE"</td><td>"NA"</td><td>emp2@test.com</td><tr>
<td>OU=VPNE"</td><td>"NA"</td><td>emp3@test.com</td><tr>
<td>"NA"</td><td>emp4@test.com</td><td> </td>
</table>

I need to make some kind of macro or update code that will fix all the cases (there are over 150,000) so that the third column doesn't exist and colums A and B only have the "NA" and then the "email".

Any help would be greatly appreciated.

Thanks,

KC
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
How did you get the data like this?

Have you split up somehow using an update query or Text>Columns... in Excel.

Do you have an example of the original raw data and also an example of the end result required?
 
Upvote 0
these colums were imported this way from a CSV file. I would like the final product to just have two columns with NA and then the email

the other garbage column should be deleted

Any help would be appreciated.

Thanks

KC
 
Upvote 0
KC

Why not choose not to import the first column when you are in the Import Wizard?
 
Upvote 0
If I understand what you're after, you could try this (you'll need to change table and field names to suit) :
1. Create and run this query --
UPDATE Table1 SET Table1.[Column A] = [Column B]
WHERE (((Table1.[Column A])<>"NA"));
2. Now create and run this query --
UPDATE Table1 SET Table1.[Column B] = [Column C]
WHERE (((Table1.[Column B])="NA"));
3. Now go to the table and delete Column 3 (best done in Design view).

This will leave you with ONLY "NA" in Column A, all "NA" in Column B replaced with the corresponding email addresses in Column C, and then Column C manually removed.

Note: make a copy of the table before proceeding, so you have a fall-back position. The process could be automated but I prefer to check intermediate steps, particularly if you are making permanent changes to your data.

Denis
 
Upvote 0

Forum statistics

Threads
1,221,834
Messages
6,162,268
Members
451,758
Latest member
lmcquade91

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