Convert "multi line" data to "single line" database

rhobert

New Member
Joined
Aug 24, 2011
Messages
7
Hello all,

I have received an Excel file that is structured as follows.
customer 1 IDcustomer 1 namecustomer 1 emailcustomer 1 website
customer 1 addresscustomer 1 post code
customer 2 IDcustomer 2 namecustomer 2 emailcustomer 2 website
customer 2 addresscustomer 2 post code

(there are more columns, this is to give you an idea). There are around a 1,000 customers and each customer has 4 lines. Some cells have been merged.

I need to convert this to a single line database: all data for each customer needs to be on a single line.

How to achieve this (easily)?

regards,
rhobert
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
You say each customer (I assume customer ID) has 4 lines, yet you show 2 for each.
Would you provide some samples using XL2BB?
 
Upvote 0
If you don't want to use VBA: with 2 lines like your initial example, you might try modifying the following.
Then select all, copy, paste special values.
Then filter and select only the blanks (from Column A) and delete those rows. Then, un-filter.
If there are more than 2 lines associated with each ID, you could adapt this to use MOD.

FileFolderFileDetails.xlsm
ABCDEFGHIJ
1IDField 1Field 2Field 3Field 4Field 5
2123AAABBBCCCDDDEEEFFFGGGHHHJJJ
3FFFGGGHHHJJJ    
4456XXXXYYYYZZZZAAAABBBBQQQRRRSSSTTT
5QQQRRRSSSTTT    
Sheet6
Cell Formulas
RangeFormula
G2:J5G2=IF(ISEVEN(ROW()),B3,"")
 
Upvote 0
CodeNaamZoekcodeTelefoonKlantBron
AdresContactpersoonFaxLeverancier
PostcodePlaatsBankrekeningE-mailBtw-nummer
LandWebsite
1000914Company 1V
Hofplein 2001Financiële administratie
3032 LKRotterdamperson@domain.com
Nederland
1000906Super HospitalV
Prins Emptystraat 99D. Superwoman
3576ZZCapelle aan den IJsselabc@def.nl
Nederland



This is a screenshot, just to be sure

Picture1.png
 
Upvote 0
Try this or something close; then copy, paste special values; then filter on blanks in column A, and delete those; then remove the filter.

FileFolderFileDetails.xlsm
ABCDEFGHIJKLMNOPQ
1IDNaamZoekcodeTelefoonKlantBronAdresContactpersoonFAXLeverancierPostcodePlaatsBankrekeningE-MailBtw-nummerLand
21000914Company 1VHofplein 2001 Financiële administratie  3032 LKRotterdam person@domain.com Nederland
3Hofplein 2001Financiële administratie         
43032 LKRotterdamperson@domain.com         
5Nederland         
61000906Super HospitalVPrins Emptystraat 99 D. Superwoman 3576ZZCapelle aan den IJssel abc@def.nlNederland
7Prins Emptystraat 99D. Superwoman         
83576ZZCapelle aan den IJsselabc@def.nl         
Sheet6
Cell Formulas
RangeFormula
G2:K2,G3:J8G2=IF(2=MOD(ROW(),4),IF(ISBLANK(B3),"",B3),"")
L2:P2,L3:O8L2=IF(2=MOD(ROW(),4),IF(ISBLANK(B4),"",B4),"")
Q2:Q8Q2=IF(2=MOD(ROW(),4),IF(ISBLANK(B5),"",B5),"")
 
Upvote 0
Solution
Great. Glad it worked for you. Thanks for the confirmation.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,572
Members
448,972
Latest member
Shantanu2024

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