+ Reply to Thread
Results 1 to 14 of 14

Separate string of text into 3 columns

  1. #1
    Registered User
    Join Date
    02-03-2018
    Location
    Manchester, UK
    MS-Off Ver
    2013
    Posts
    76

    Separate string of text into 3 columns

    Hi all,

    I'm curious how I can split the text below into three separate columns. Here's the text:

    04 Jan 21T K MAXX£10.27

    Column 1 - 04 Jan 2021
    Column 2 - T K Maxx
    Column 3 - £10.27

    Would there be a formula that could do all this?

    Many thanks for your help,

    Lee.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Separate string of text into 3 columns

    Do the values always follow the same format with a "dd mmm yy" date format at the start, a price with a £ at the end and other stuff in between?

    BSB

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Separate string of text into 3 columns

    One way (maybe...)

    =LEFT(A2,9)+0 (format as date)

    and

    =MID(A2,10,SEARCH("£",A2)-10) (format as General)

    and

    =MID(A2,SEARCH("£",A2)+1,255)+0 (format as currency)
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Separate string of text into 3 columns

    with file...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-03-2018
    Location
    Manchester, UK
    MS-Off Ver
    2013
    Posts
    76

    Re: Separate string of text into 3 columns

    That's fantastic - works perfectly.

    One issue cropped up which the formula didn't pick up on were minus payments. Could a formula pick those up and add the '-' in there too?.

    Thanks for your help,

    Lee.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Separate string of text into 3 columns

    How are they designated £-100.00 or as -£100.00?

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Separate string of text into 3 columns

    Please post a sample Excel file. I want to see if there is a CHAR(10) in between the date/name/amount sections.

    Instructions are in yellow banner, top of page.

  8. #8
    Registered User
    Join Date
    02-03-2018
    Location
    Manchester, UK
    MS-Off Ver
    2013
    Posts
    76

    Re: Separate string of text into 3 columns

    Quote Originally Posted by Glenn Kennedy View Post
    How are they designated £-100.00 or as -£100.00?
    They are designated as -£12.00.

    Lee.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Separate string of text into 3 columns

    OK. So, a sample file with a few REAL examples, please.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Separate string of text into 3 columns

    I would STILL prefer to see some real values... uncorrupted by the Forum's occasionally bizarre thread formatting... but this works:

    B2:
    =LEFT(A2,9)+0 format as date.

    C2:
    =MID(A2,10,IFERROR(SEARCH("-£",A2),SEARCH("£",A2))-10) format as General

    D2:
    =MID(A2,SEARCH("£",A2)+1,255)*IF(ISNUMBER(SEARCH("-£",A2)),-1,1)

    copied down...

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Separate string of text into 3 columns

    Duhh. forgot the file... again.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    02-03-2018
    Location
    Manchester, UK
    MS-Off Ver
    2013
    Posts
    76

    Re: Separate string of text into 3 columns

    Amazing - many thanks for your help in this. It would have taken hours to work that out on my own. You've saved me a lot of time and hassle.

    Thanks again,

    Lee.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Separate string of text into 3 columns

    You're welcome... thanks for the rep, but remember to post a sample sheet next time. It makes everything SO much easier...

  14. #14
    Registered User
    Join Date
    02-03-2018
    Location
    Manchester, UK
    MS-Off Ver
    2013
    Posts
    76

    Re: Separate string of text into 3 columns

    Quote Originally Posted by Glenn Kennedy View Post
    You're welcome... thanks for the rep, but remember to post a sample sheet next time. It makes everything SO much easier...
    OK, thanks. I'll keep that in mind to post sheets.

    Lee.

+ 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. Macro to separate long string of characters and several spaces into separate columns
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-31-2017, 07:37 PM
  2. [SOLVED] Formula or function to separate string of text in a cell to multiple columns
    By Chris McGlothen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-29-2016, 12:10 PM
  3. [SOLVED] Splitting Text String Into Separate Columns
    By robertguy in forum Excel General
    Replies: 2
    Last Post: 02-06-2016, 01:26 PM
  4. Replies: 2
    Last Post: 04-09-2014, 11:48 AM
  5. [SOLVED] Separate numeric/text combination into two separate columns.
    By Jim15 in forum Excel General
    Replies: 6
    Last Post: 10-09-2013, 05:49 PM
  6. [SOLVED] How to separate a text string into two columns?
    By pgft in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-13-2013, 05:15 AM
  7. Separate a FirstLast text string into two columns
    By drewannie in forum Excel General
    Replies: 5
    Last Post: 07-05-2006, 07:10 PM

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