Results 1 to 4 of 4

Trimming text from a sheet with teams and scores of games

Threaded View

  1. #1
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London England
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    157

    Question Trimming text from a sheet with teams and scores of games

    Hi,

    I've got one of my usual kind of queries, but I've learned something from the last query that I had involving trimming text but I'm still running into grief with trimming exactly what I want out of the data.

    In short teams are now coming in like this (in one cell):

    Großwallstadt vs. Melsungen

    I'm trimming the spaces out with a (assuming the above is in B2):

    =SUBSTITUTE(CLEAN(TRIM(B2)),CHAR(160),"")

    I'm then trimming the teams out with a:

    =TRIM(LEFT(SUBSTITUTE(F2," vs. ",REPT(" ",LEN(F2))),LEN(F2)))

    and a

    =TRIM(MID(SUBSTITUTE(F2," ",REPT(" ",LEN(F2))), 2*LEN(F2),LEN(F2)))

    and then trimming the spaces out from around the results.

    Scores are coming in like 22:24 (in column M)

    so I'm going with:

    =TRIM(LEFT(SUBSTITUTE(M2,":",REPT(" ",LEN(M2))),LEN(M2)))

    and

    =TRIM(MID(SUBSTITUTE(M2,":",REPT(" ",LEN(M2))), LEN(M2),LEN(M2)))

    I have attached a copy of the xls for reference. In short, the above formulas seem to be working okay but not perfectly (which makes me think, I may have not referenced something properly and am possibly picking up spaces as well?). The team formulas seem to work okay generally but don't seem to handle teams with spaces in them, and on one line it's actually taken a vs. instead of a team (I've highlighted the lines in red where it's thrown up issues). I'm aware that I could use a left and a right on the score cells as most of the time the scores will only be double digit, but I'm just looking for a clean way to handle single or triple digit scores.

    Any advice or pointers would be appreciated.

    Thanks in advance,

    Bundesliga 12_13 Results_Workup.xls
    Last edited by mrvp; 09-10-2012 at 03:54 PM. Reason: solved.....

Thread Information

Users Browsing this Thread

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

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