+ Reply to Thread
Results 1 to 2 of 2

Removing blank space from LEFT & RIGHT formula

  1. #1
    Registered User
    Join Date
    12-04-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    79

    Removing blank space from LEFT & RIGHT formula

    Hi all,

    I have a cell with the contents "7 : 1"

    I then have two lovely formula in the cells below:
    =LEFT(C45, SEARCH(":",C45,1)-1)
    =RIGHT(C45,LEN(C45)-SEARCH(":",C45,SEARCH(":",C45)-1))

    What I need is for the formula to return the values "7" and "1"

    What I am getting is "7 " and " 1".

    How can I alter the formula to remove the space that is being returned before/after the number.

    NOTE: this needs to work for when the 7 is double or triple digits. ie. "13 : 2" or "781 : 1"

    Thanks

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Removing blank space from LEFT & RIGHT formula

    hi there. wrap your formula with TRIM
    =TRIM(RIGHT(C45,LEN(C45)-SEARCH(":",C45,SEARCH(":",C45)-1)))

    or:
    =RIGHT(C45,LEN(C45)-SEARCH(":",C45)-1)
    or:
    =MID(C45,FIND(": ",C45)+2,LEN(C45))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ 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] Formula to Return Everything LEFT of the 1ST space following a dash...
    By rjw524 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-06-2015, 08:08 PM
  2. [SOLVED] Formula for removing space or unknown character. (Trim is not working)
    By senthile in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-06-2014, 04:08 PM
  3. Replies: 8
    Last Post: 09-09-2013, 08:46 AM
  4. Removing blank space or spaces at end of a string
    By grumpyguppy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-14-2013, 03:34 AM
  5. Removing a space in two different spots in a formula
    By Virgil Beach in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-04-2012, 12:46 PM
  6. [SOLVED] fix formula for a 0 if blank space
    By sacrous in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-28-2012, 10:03 AM
  7. Pull from left until Blank (Space)
    By maxthebear in forum Excel General
    Replies: 4
    Last Post: 01-05-2010, 03:04 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