+ Reply to Thread
Results 1 to 9 of 9

macro or function to count the number of 'number' characters in a cell

  1. #1
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    macro or function to count the number of 'number' characters in a cell

    Hi All,

    Need your help again, i'm looking for a macro/function to count the number of "numbers listed" in a cell (regardless what is their delimiter: ex: space, comma, semi-colon, ~, -)

    Attached is a sample output (manual)

    Thanks!
    Attached Files Attached Files
    Last edited by aarona; 07-30-2019 at 05:15 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: macro or function to count the number of 'number' characters in a cell

    That's not the number of characters - it's the number of words (numbers listed). Is that what you meant?

    Try this in B2:

    =LEN(A2)-LEN(SUBSTITUTE(A2," ",""))+1
    Last edited by AliGW; 07-30-2019 at 05:09 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    Re: macro or function to count the number of 'number' characters in a cell

    Thanks AligW, yes you are correct, however the formula will only work if the delimiter is *space*, looking for a solution that will work whatever delimiter is used. But still thanks, for the suggestion I can still use this.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: macro or function to count the number of 'number' characters in a cell

    Well, we can't help unless you tell us what other delimiters you are using. Post more meaningful sample data and you might get a better solution.

  5. #5
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    Re: macro or function to count the number of 'number' characters in a cell

    Thanks AligW, updated the original post.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: macro or function to count the number of 'number' characters in a cell

    UDF

    Use in cell like
    =CountNumbers(A2)
    Please Login or Register  to view this content.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: macro or function to count the number of 'number' characters in a cell

    Not good enough. We need a COMPLETE list of delimiters used. Don't post-edit your posts, please - it makes the thread hard to follow.

  8. #8
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    Re: macro or function to count the number of 'number' characters in a cell

    Quote Originally Posted by jindon View Post
    UDF

    Use in cell like
    =CountNumbers(A2)
    ...
    Thanks Jindon! working
    Last edited by AliGW; 07-30-2019 at 05:21 AM. Reason: Please don't quote unnecessarily!

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: macro or function to count the number of 'number' characters in a cell

    You are welcome and thanks for the rep.

+ 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] How to count the number of characters in a cell
    By adr150 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-23-2018, 08:17 AM
  2. [SOLVED] Vba code to count the number of characters from a cell and to do an action
    By IonutC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-04-2016, 05:50 AM
  3. checking number of characters in a cell macro
    By mehdoush in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-08-2014, 02:13 PM
  4. [SOLVED] how to count number of characters in a cell
    By Mile029 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-05-2013, 11:09 PM
  5. Count the number of Characters in a cell?
    By IGinc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-20-2009, 03:02 AM
  6. Count Number of Characters in a cell?
    By AHJuncti in forum Excel General
    Replies: 2
    Last Post: 06-16-2005, 02:39 PM
  7. How do you count number of characters in a single cell
    By Joe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-18-2005, 06:06 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