+ Reply to Thread
Results 1 to 7 of 7

Is there a formula i can write to help me format this import error?

  1. #1
    Registered User
    Join Date
    11-08-2016
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    4

    Is there a formula i can write to help me format this import error?

    See attached pic for more context but essentially by data is getting imported incorrectly. I have a field that allows multi-line input and it looks like during the import it's putting each one of those lines into a seperate row. Is there a formula/formatting trick i can use to concatinate this?



    Capture.PNG

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Is there a formula i can write to help me format this import error?

    I can't read your picture (nor could I edit it to play about with some formulae). Please attach a sample Excel workbook instead.

    Pete

  3. #3
    Registered User
    Join Date
    11-08-2016
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    4

    Re: Is there a formula i can write to help me format this import error?

    Thanks for your reply Pete. Uploaded the document
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Is there a formula i can write to help me format this import error?

    I've taken a quick look at this, although it's getting quite late here (nearly 2:00am), so I can't progress with it just now.

    It would help, though, if you could indicate how you would like the first few records to appear, maybe on a separate sheet, as it is not clear to me what the numbers in column A represent. If nobody comes back to you while I'm asleep, I'll take another look in the morning.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    11-08-2016
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    4

    Re: Is there a formula i can write to help me format this import error?

    It's all part of a larger data set so I was really hoping to get it all in the same column and seperated by a comma or another dilimeter.

    Thanks for looking at this btw
    Last edited by farout60; 09-25-2018 at 09:07 PM.

  6. #6
    Registered User
    Join Date
    11-08-2016
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    4

    Re: Is there a formula i can write to help me format this import error?

    Before

    Column1 Column2
    1
    2 ipad mini 3 lcd replacement
    3 ipad 2 lcd replacment
    4 ding on the corner
    5
    6 repair screen
    7 batter replacement
    8 replace camera
    9 Computer running slow
    Check for virus and optimize
    10 Computer running slow
    Check for virus and optimize
    11 Computer and Monitor
    Keyboard
    recipe printer
    Solid State Drive
    Pos Software
    12 Computer and Monitor
    Keyboard
    recipe printer
    Solid State Drive
    Pos Software


    After

    Column1 Column2
    1
    2 ipad mini 3 lcd replacement
    3 ipad 2 lcd replacment
    4 ding on the corner
    5
    6 repair screen
    7 batter replacement
    8 replace camera
    9 Computer running slow ,Check for virus and optimize,Check for virus and optimize
    10 Computer running slow ,Check for virus and optimize,Check for virus and optimize
    11 Computer and Monitor,Keyboard ,recipe printer,Solid State Drive,Pos Software
    12 Computer and Monitor,Keyboard ,recipe printer,Solid State Drive,Pos Software

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Is there a formula i can write to help me format this import error?

    I've used two helper columns (D and E, shown in blue) with this formula in D2:

    =IF(AND(ISNUMBER(Test[[#This Row],[Column1]]*1),LEN(Test[[#This Row],[Column1]])<5),Test[[#This Row],[Column1]]*10,D1+1)

    and this one in E2:

    =IF(MOD(D2,10)=0,D2/10,"")

    These are copied down to the bottom of your data and help to identify where each new record occurs, and where fields have been split. Then I have used this formula in G2:

    =ROWS($1:1)

    and this one in H2:

    =IF(ISNA(MATCH(G2,E:E,0)),"",INDEX(B:B,MATCH(G2,E:E,0)) & IFERROR(", "&INDEX(A:A,MATCH(G2*10+1,D:D,0)),"") & IFERROR(", "&INDEX(A:A,MATCH(G2*10+2,D:D,0)),"") & IFERROR(", "&INDEX(A:A,MATCH(G2*10+3,D:D,0)),"") & IFERROR(", "&INDEX(A:A,MATCH(G2*10+4,D:D,0)),"") & IFERROR(", "&INDEX(A:A,MATCH(G2*10+5,D:D,0)),"") )

    which put the data in the format your require, although you may want to move these into a different sheet. These can be copied down as far as you need them, but if you copy too far then you will get blanks, as can be seen at the bottom.

    You can see with the final formula that many of the terms are very similar - they just vary by the increment shown in red. The formula will cater for up to 5 fields which are split for each record, but if you need more than that (maximum of 9) you can copy the section shown in blue to the end of the formula (inside the final closed bracket), and just change the increment as required.

    Hope this helps.

    Pete
    Attached Files Attached Files

+ 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. [SOLVED] Write Sub procedure to format excel and write case/if statement to text file
    By vbronton in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-06-2018, 08:26 AM
  2. CountIfs write formula in cell error
    By bmxrayser in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2015, 12:25 AM
  3. [SOLVED] Getting error 1004 trying to write formula in cell
    By Trefor in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-23-2005, 07:15 PM
  4. How to write a formula that will prevent appearance ERROR MESSAGE
    By Huriiii in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2005, 12:05 PM
  5. [SOLVED] How to write a formula that will prevent appearance ERROR MESSAGE
    By CLR in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 07:05 AM
  6. How to write a formula that will prevent appearance ERROR MESSAGE
    By Huriiii in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. How to write a formula that will prevent appearance ERROR MESSAGE
    By Huriiii in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-21-2005, 08:05 PM

Tags for this Thread

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