+ Reply to Thread
Results 1 to 8 of 8

Extract Space and ft

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    Jacksonville
    MS-Off Ver
    Excel 2010
    Posts
    74

    Extract Space and ft

    I was able to find help with the MID formula and still trying to figure out what the heck the "~" part means as there is no ~ in my cell I am trying to separate but it's working so I'll work on that knowledge but the part I can't get is the last part.

    Expected result
    9.5

    Actual Result
    (space)9.5(space)ft

    How can I get the spaces and the "ft" off so it just says 9.5?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Extract Space and ft

    Here's one that works.
    I am sure there is one that's shorter.
    I'll see if I can work it out later.

    HTML Code: 
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  3. #3
    Registered User
    Join Date
    11-01-2012
    Location
    Jacksonville
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Extract Space and ft

    YOU ARE A SAINT!!! Thank you so much Now to get to understanding it fully so I don't have to bother ya'll about this again

  4. #4
    Registered User
    Join Date
    11-01-2012
    Location
    Jacksonville
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Extract Space and ft

    OOOOOO I get the squiggly line now! My buddy said they used it to separate things in some other program so now that makes sense in reading the formula now Going to practice!!!

    Thanks again. Really

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Extract Space and ft

    Try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Extract Space and ft

    If you want to extract values in Col A into separate cells use this:
    Enter formula in B2 and drag it across and down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B C D
    1 Dimensions Left Mid Right
    2 25.3 X 8.11 X 9.5 ft 25.3 8.11 9.5
    3 24.3 X 8.11 X 9.2 ft 24.3 8.11 9.2
    4 28.1 X 8.11 X 10.1 ft 28.1 8.11 10.1
    5 29.8 X 11.1 X 9.1 ft 29.8 11.1 9.1
    6 29.6 X 8.4 X 10.6 ft 29.6 8.4 10.6
    7 31.2 X 10.5 X 9.7 ft 31.2 10.5 9.7

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Extract Space and ft

    Hi MnMCarta,

    Here is another method I think you should learn. It uses the TRIM function that removes all spaces before and after any text or numbers.

    =TRIM(SUBSTITUTE(MID(SUBSTITUTE($A12,"X",REPT(" ",30)),30*(COLUMNS($A:A)-1)+1,30),"ft",""))

    Blow Up Spaces Mid and Trim.xlsx

    Here is how it works:
    Start with your
    25.3 X 8.11 X 9.5 ft
    If you replace each of the "X" with 30 spaces (using "Substitute($a12,"X",Rept(" ",30))") it will look like:
    25.3 8.11 9.5 ft
    Then you need to grab the first 30 characters and TRIM() them and the next 30 characters and TRIM() them and then the last 30 characters and Trim() them.
    This TRIM() will remove all those spaces you just put into the string but leave the non space characters.
    Just before you do that, you need to Substitute that pesky "ft" with nothing, using Substitute(...,"ft","").

    The Mid() function allow you to start at a different part of the string and you want to start at 1,30 and 60 and take the next 30 characters before trimming them.

    I hope this formula is a little cleaner and is a tool you can use for many of your problems.

    It looks like AlKey beat me to the formula. Learn it instead of the "~" formula as it is a little more versatile.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Extract Space and ft

    ....what the heck the "~" part means...

    In the formula:

    =RIGHT(A2,LEN(A2)-FIND("~",SUBSTITUTE(A2,"X","~",2)))

    The SUBSTITUTE function replaces the second X in the dimensions string with the TILDE (~) character, resulting in 25.3 X 8.11 ~ 9.5 ft
    The FIND function returns the position of tilde, which indicates the starting position of the last dimension.
    The number of characters returned is calculated with:

    LEN(A2)-FIND("~",SUBSTITUTE(A2,"X","~",2))

    which includes the " ft"
    Last edited by protonLeah; 06-21-2018 at 06:43 PM.
    Ben Van Johnson

+ 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] Extract 2nd Character after space in string
    By sintek in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-08-2017, 08:12 AM
  2. [SOLVED] How to extract text before & after a space from the right?
    By calvinsiewy2k in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-19-2017, 10:05 PM
  3. [SOLVED] Extract word after specifying blank space
    By Karnik in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-08-2016, 03:31 AM
  4. Extract text between # and space
    By bp2010 in forum Excel General
    Replies: 3
    Last Post: 12-21-2010, 07:48 PM
  5. Extract text from string after , before a space
    By Dulanic in forum Excel General
    Replies: 1
    Last Post: 05-24-2010, 08:20 AM
  6. Extract text with space
    By maxthebear in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2009, 08:01 PM
  7. Extract data after space
    By lmohaxx in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-16-2008, 09:40 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