Question

I have a spreadsheet with the following values:

CUST_ID, NAME, PHONE, EMAIL
0000, John Smith, 000-223-4567, test@email.com
0000, Ed Jones, 001-323-4567, test1@email.com
0000, Frank Dill, 002-423-4567, test2@email.com
0001, Rich Pickle, 003-523-4567, test3@email.com
0001, Phil Burger, 004-623-4567, test4@email.com
0001, Brian Mac, 005-723-4567, test5@email.com
0002, Slick Whopper, 006-823-4567, test6@email.com
0003, Name Finger, 007-923-4567, test7@email.com

...

Importing this table into Access, it would rather have it going horizontal based on CUST_ID (because of the form I have setup for the data)

So the spreadsheet should look something like this...

CUST_ID, NAME_1, PHONE_1, EMAIL_1, NAME_2, PHONE_2, EMAIL_2, NAME_3, PHONE_3, EMAIL_3
0000, John Smith, 000-223-4567, test@email.com, Ed Jones, 001-323-4567, test1@email.com, Frank Dill, 002-423-4567, test2@email.com
0001, Rich Pickle, 003-523-4567, test3@email.com, Phil Burger, 004-623-4567, test4@email.com, Brian Mac, 005-723-4567, test5@email.com
0003, Name Finger, 007-923-4567, test7@email.com

I already manually moved 50 of them using copy and paste method, but there are 150 more to do, and this way is very time consuming. The paste special, transpose method doesn't work because when you do that the matrix looks like this...(per CUST_ID)

CUST_ID, N_1, P_1, E_1                    N_1, N_2, N_3
CUST_ID, N_2, P_2, E_2     -------->      P_1, P_2, P_3
CUST_ID, N_3, P_2, E_3                    E_1, E_2, P_3

I need it to look like this...

CUST_ID, N_1, P_1, E_1, N_2, P_2, E_2, N_3, P_3, E_3
Was it helpful?

Solution

Bit of a weird issue, but why not try this.

Add a new column, Name the column 3 (just the number 3) then in A2 put in =if(A1=3,1,A1+1)

Copy that formula all the way down, so it just goes 1,2,3,1,2,3 etc...

Then in the cells at the end of John Smith's row, put in =B3 =C3 =D3 etc...

at the end of that one, but in =B4 =C4 =D4 etc...

Copy all that data down, right to the bottom.

Select all cells, copy and paste as values. Then sort the whole thing by Column A.

Delete anything that doesn't have a 1 in column A, and you're left only with the data in the format you need.

Not the most elegant solution, but it should work quickly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top