I have a comma separated file that can be opened in excel. In this file I have the data in two columns like this:
Title: A1
Ref: A2
URL Address: A3
Cost Value: A4
Title: B1
Ref: B2
URL Address: B3
Cost Value: B4
Title: C1
Ref: C2
URL Address: C3
Second URL Address: C4
Cost Value: C5
and then the same Lines are repeated with different data obviously.
Now, the issue is that some times there are 4 Lines and some times there are 5 Lines (in case there is "Second URL Address").
I would like to transfer those two columns into multiple columns as shown below:
Title Ref URL Address Second URL Address Cost Value
A1 A2 A3 A4
B1 B2 B3 B4
C1 C2 C3 C4 C5
I can Import into Excel and then use Text To Columns to split on colon and then use pivot table to split into columns, but the problem is that URL addresses are having colon and sometimes also the Title might have colon.
Appreciate any suggestions.
I think there are 2 parts to the question. 1st is to resolve the bit on making sure all cost values go into the 5th row. This can be done with formula.
I.e. in cell A6, input the formula
=IF(A5="","",A4)
and in cell A7, input the formula
=IF(A5="",A4,A5)
Drag those formulas to the right, until the final populated column is reached.
After that, paste value row 6 & 7 into rows 4 & 5.
Then delete rows 6 & 7.
This will align your fields
To address the 2nd part of the question, ie multi columns
You can the copy the whole thing, and paste as transpose in a new sheet, hence you don't have to delimit it
I do not think you can get the format you want with a pivot table.
But lets assume I am wrong and fix the first problem (delimiting). Someone clever may fix the other part.
You can do a " Find and Replace ". Search for ": " and replace with ^
This should work as the colon in a URL will not have a space after it. Hopefully the same for other fields.
Then you can do text->columns using ^ as the delimiter. Now you have 2 columns of data.
As I said, the second part is challenging and can be done but quite messy in excel as you basically want to pivot text and excel doesn't love that.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.