+ Reply to Thread
Results 1 to 6 of 6

Import text into multiple columns Excel

  1. #1
    Registered User
    Join Date
    02-09-2014
    Location
    Canada
    MS-Off Ver
    Excel for Mac 2011
    Posts
    7

    Import text into multiple columns Excel

    Hi there,

    I am trying to figure out if there is a way to do the following.

    I have a text document containing various data sorted in lines, which looks something like this :

    Data 1.A
    Data 1.B
    Data 1.C
    Data 1.D
    Data 2.A
    Data 2.B
    Data 2.C
    Data 2.D
    Data 3.A
    Data 3.B
    Data 3.C
    Data 3.D
    And so on.

    I would like to import this text document into Excel and have every ".A"-ending lines sorted into separate rows of column A, every ".B"-ending lines sorted into separate rows of column B, etc.


    Is that something that can be done ?

    Thanks in advance for the followup and have a great day.

    Best regards,
    Etienne

  2. #2
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: Import text into multiple columns Excel

    Depending on complexity and time you want to invest:
    Assumes your data resides in col A.
    Run your formulas, paste all back as values, and delete your column A.
    Place this into B1:
    Please Login or Register  to view this content.
    copy down
    Place this into C1:
    Please Login or Register  to view this content.
    "
    Place this into D1:
    Please Login or Register  to view this content.
    "
    Place this into E1:
    Please Login or Register  to view this content.
    "

    Pete

  3. #3
    Registered User
    Join Date
    02-09-2014
    Location
    Canada
    MS-Off Ver
    Excel for Mac 2011
    Posts
    7

    Re: Import text into multiple columns Excel

    Hi there,

    PeteABC123 : thanks for the suggestion. This formula doesn't seem to work in my case, though. I believe this is because the data in my text document doesn't really end by "A", "B", "C" and "D", like the example in my first post suggested. This was only a way for me to express that there were different "categories" of data that repeat themselves on a regular basis in my document (five categories, to be more precise).

    I have now imported all the text data in column A of an Excel document. Hence, what I am trying to do now, is to gather the data residing in A1, A6, A11, A16 and so forth into column B, the data in A2, A7, A12, A17, etc. into column C, the data in A3, A8, A13, A18, etc. into column D, the data in A4, A9, A14, A19, etc. into column E and the data in A5, A10, A15, A20, etc. into column F.

    Is there a way to do this without having to link every cell individually ?

    Thanks in advance for the help.

    Best,
    Etienne
    Last edited by sacblanc; 02-09-2020 at 01:30 PM.

  4. #4
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: Import text into multiple columns Excel

    Establish what the different criteria is in each cell in column A. Instead of using the RIGHT function, use wildcard characters "*". . .if cell contains etc. Might have your criteria at the top of the column you want the results brought into, and copy down.

    HTH.

    Pete

  5. #5
    Registered User
    Join Date
    02-09-2014
    Location
    Canada
    MS-Off Ver
    Excel for Mac 2011
    Posts
    7

    Re: Import text into multiple columns Excel

    Hi there,

    Thanks again for the help.

    It seems that this will not resolve the problem, as there are no "defining" or "different" characteristics to the cells in column A. They are only made of text, with no redundancy among it.

    The easiest solution that I see would be to refer to =A1 in B1, =A6 in B2, =A11 in B3, and then copy down B1, B2 and B3 until I cover all the range of column A, but Excel doesn't seem to "understand" the logic of this manipulation (i.e. refer to cells in column A with 5-rows jump increments) when I do the copy down.

    Is there anything else I could try ?

    Best,
    Etienne
    Last edited by sacblanc; 02-09-2020 at 03:15 PM.

  6. #6
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,823

    Re: Import text into multiple columns Excel

    Try putting this formula in B1, and then copy down and across.
    =IF(OFFSET($A1,(ROW()-1)*4+COLUMN()-2,0)=0,"",OFFSET($A1,(ROW()-1)*4+COLUMN()-2,0))

    Just going off you post #3, it should work for that.
    Does this help?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. import text columns into excel
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 41
    Last Post: 06-15-2019, 10:03 AM
  2. Import from text files and split into columns in Excel
    By kay007 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-03-2018, 07:22 AM
  3. Import text file that contains rows into excel as columns
    By cbiz in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 03-14-2017, 01:54 PM
  4. Text file to excel columns import
    By ROHAN999 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2013, 01:44 AM
  5. Macro to Parse Text - Import text to Excel from Multiple Text Files & Folders
    By Novice_To_Excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2012, 01:05 AM
  6. Import Text File Ddata Into Excel Spreadsheet - Multiple Columns & Rows
    By DOgburn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2012, 04:45 PM
  7. Import Text file Fields as Columns in Excel
    By vijay2482 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2009, 11:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1