+ Reply to Thread
Results 1 to 10 of 10

count the number of digits in a cell after the first space

  1. #1
    Registered User
    Join Date
    07-01-2012
    Location
    Tilburg, the Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    96

    count the number of digits in a cell after the first space

    Hi all,

    I need a formula that counts the number of digits in a cell, but I am interested only in the specific place within a cell. Lets consider the following case:

    00024658 345600 BDD AMSTERDAM

    I need to show in the next cell the following set of digits: 345600 - the one that starts right after the first space and ends before the second space. I decided to count the number of digits first, but maybe you know the other way to do that? Thanks a lot in advance!

    Karol

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,054

    Re: count the number of digits in a cell after the first space

    Maybe this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    07-01-2012
    Location
    Tilburg, the Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: count the number of digits in a cell after the first space

    thank you, but it doesnt work, I just wanted to add that I am interested in one cell each time - for example, Ive got such sequence: 00024658 345600 BDD AMSTERDAM in cell A1 and I need to have 345600 in cell B1. Hope you know what I mean.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719

    Re: count the number of digits in a cell after the first space

    To get everything between 1st and 2nd space try this formula

    =TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",99)),99,99))
    Audere est facere

  5. #5
    Registered User
    Join Date
    07-01-2012
    Location
    Tilburg, the Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: count the number of digits in a cell after the first space

    daddylonglegs `this formula contains an error`, and then excel highlights this part of a formula:

    A1,"

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: count the number of digits in a cell after the first space

    See ddl's, formula in action...
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  7. #7
    Registered User
    Join Date
    07-01-2012
    Location
    Tilburg, the Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: count the number of digits in a cell after the first space

    thanks! the formula that you put in the file works really well.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719

    Re: count the number of digits in a cell after the first space

    Just to clarify....

    separators in formulas can differ depending on regional settings so my commas probably need to be semi-colons for Dutch(?) regional settings, i.e.

    =TRIM(MID(SUBSTITUTE(A1;" ";REPT(" ";99));99;99))

    When I open Fotis's file I see commas but I presume you see semi-colons - they will change depending on regional settings...

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: count the number of digits in a cell after the first space

    "Thanks" belong to ddl. Not to me!

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: count the number of digits in a cell after the first space

    Yes ddl. I see semi colons. Not comma!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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