+ Reply to Thread
Results 1 to 2 of 2

Split complicated text/numbers string with functions

  1. #1
    Registered User
    Join Date
    08-26-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    1

    Split complicated text/numbers string with functions

    Hello!

    I have tournament data in the following form. Each of the following lines of text is located in one single cell all in one single column. I give three such entries but there are hundreds of them in total.

    1Zwischenzug12Carni (2-0), MMorrjr12 (2-0), Lumie (2-0), Scheharezade (2-0)0.58331.00000.4975
    2Dov05512thepekay (2-1), Skwiskar664 (2-1), Grrrr (2-1), Varsity (2-0)0.52080.72730.5083
    3joefox5812punkid_41_86 (2-1), Traumerei112 (2-1), Neptoon (2-1), Ztrman (2-0)0.47920.72730.4813
    ...

    I want to split this string into different columns. Each part of the line is a different piece of information that needs to go into its own column. Looking at just the first line, here is how the different pieces break down into categories:

    "1": Place
    "Zwischenzug": Name
    "12": Points
    "Carni (2-0), MMorrjr12 (2-0), Lumie (2-0), Scheharezade (2-0)": Match records.
    "0.5833": Opponent match win %
    "1.0000": Game win %
    "0.4975": Opponent game win %

    In some cases, the records have a default format. For example, the last three (opponent match win %, game win %, and opponent game win %) all are 6 characters long in the form of N.nnnn which might make it easier to separate them out. Similarly, a player's name is always shown before their points, and a player can only have 12, 9, 6, 3, or 0 points.

    I have no idea how to separate this out. I have tried to use the Left(), Mid(), and Right() formulas, but the data is too complicated for me to get them to work. Any advice is appreciated! Note that I would prefer to do this with functions instead of with macros.

    Thanks for any help you can give! Let me know if you need any clarification to offer advice.

  2. #2
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: Split complicated text/numbers string with functions

    I didn't figure everything out, but here's what I got.
    1. You'll probably want to use the MID function. MID(A1,2,1) will give you the second character of A1.
    2. Search and Find are also helpful. You can search for specific characters and put those positions in the MID function. For example =MID(B2,FIND(" ",B2)+1,FIND(")0",B2)-FIND(" ",B2)) will give you the match records. (Assuming your first entry is in B2.)
    3. Do the same thing, searching for "." or "0." and adjusting as needed to get the win %s.
    4. Use =LEFT(B2,LOG10(ROW()-1)+1) for what place they were in.
    5. That leaves only extracting the name and the points. That will be difficult because they often have numbers in their name. You could look for the first letter (or last number) and take the previous one or two digits, depending on whether the last number is a 2 or not.
    6. Once you figure out how to find the position of the character where the name ends and points start, you can use that to extract their name. If the last name character is x, then you want MID(B2,LOG10(ROW()-1)+1,x-LOG10(ROW()-1)-1) to get the name.

    Hope this helps. I've been doing the same sort of thing. If there is an easier way to do string processing (especially when the strings are created by a human with very little consistency), I'd like to know it.

    k64

+ 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] split string in text and numbers (NBVC made it today on this forum)
    By oeldere in forum Excel General
    Replies: 4
    Last Post: 08-08-2012, 01:04 PM
  2. [SOLVED] Split Out Text Form String
    By clombardozzi in forum Excel General
    Replies: 3
    Last Post: 05-14-2012, 08:22 AM
  3. split column string data and add numbers
    By gpatel in forum Excel General
    Replies: 6
    Last Post: 12-25-2011, 10:37 PM
  4. UDF to Split Text String
    By cdrhodes in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2010, 03:40 PM
  5. Split text string to different columns
    By liarliar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2008, 09:13 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