+ Reply to Thread
Results 1 to 10 of 10

Insert space between numbers and text

  1. #1
    Registered User
    Join Date
    08-17-2012
    Location
    Pleasanton, CA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Insert space between numbers and text

    I have a list of sizes where the format is number and then text unit of measure--the number always comes first. If there is no space between the numbers and the letters I need to insert a single space. The number can be of varying length. The list is several hundred rows. Can a formula be written to do this? I've uploaded a small sample file that should pretty clearly illustrate what I am trying to do. Thanks for any help!
    Attached Files Attached Files
    Last edited by dleslieca; 08-25-2017 at 05:29 PM. Reason: Added file with sample data

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Insert space between numbers and text

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Last edited by mehmetcik; 08-25-2017 at 03:11 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    08-17-2012
    Location
    Pleasanton, CA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Insert space between numbers and text

    The file I've attached has before and after columns--probably not necessary, but illustrates what I'm trying to do--using a helper column, of course.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Insert space between numbers and text

    Formula for B2

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-17-2012
    Location
    Pleasanton, CA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Insert space between numbers and text

    Thank you for such a quick reply, but is there a way to do this without specifying the unit of measure? It can be OZ, CT, PR, etc., (I'm in a retail environment) so I'm hoping to not parse out each separately (i.e. =RIGHT(A2,2) and filter by UOM). Thank you!

  6. #6
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    485

    Re: Insert space between numbers and text

    Try the following array formula (to be entered using Ctrl+Shift+Enter, not just Enter):

    =TRIM(REPLACE(A2,MAX(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9},A2,ROW(INDIRECT("1:"&LEN(A2)))),0))+1,0," "))

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Insert space between numbers and text

    Here's another way, but it's rather "dicey". If any of the UOMs can be interpreted by Excel as part of a number (date, scientific notation ... et.al.) this will not work on those.

    That said:
    In C2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    A
    B
    C
    1
    Before
    After--with space
    2
    6OZ
    6 OZ
    6 OZ
    3
    5.5OZ
    5.5 OZ
    5.5 OZ
    4
    16OZ
    16 OZ
    16 OZ
    5
    9OZ
    9 OZ
    9 OZ
    6
    7.5OZ
    7.5 OZ
    7.5 OZ
    7
    10OZ
    10 OZ
    10 OZ
    Dave

  8. #8
    Registered User
    Join Date
    08-17-2012
    Location
    Pleasanton, CA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Insert space between numbers and text

    That's perfect--thank you!

  9. #9
    Registered User
    Join Date
    08-17-2012
    Location
    Pleasanton, CA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Insert space between numbers and text

    Dave, yours worked well also--thank you! I'll save both formulas for future reference--this probably won't be the last time I get poorly formatted data.

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Insert space between numbers and text

    You are welcome. Thank you for the feedback and marking your thread Solved. It helps.

+ 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] trimming space between splitting numbers and text
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-04-2017, 01:17 PM
  2. Please help! loop/Insert text in first blank space
    By pkilsby1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-12-2015, 02:29 PM
  3. [SOLVED] Insert space in part numbers
    By Allgermanparts in forum Excel General
    Replies: 4
    Last Post: 06-19-2013, 09:00 AM
  4. [SOLVED] Long String of text and need to insert space every 8th character
    By jbang917 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-12-2013, 03:45 PM
  5. [SOLVED] Insert a space in front of all upper case text
    By excelrod in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2012, 12:02 PM
  6. [Solved] Removing numbers and space before text
    By loyski in forum Excel General
    Replies: 5
    Last Post: 02-07-2012, 11:36 AM
  7. How can I insert a space btw lines of text?
    By jspence in forum Excel General
    Replies: 1
    Last Post: 06-17-2011, 01:56 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