+ Reply to Thread
Results 1 to 5 of 5

Counting a range of cells that include text and numbers

  1. #1
    Registered User
    Join Date
    08-28-2015
    Location
    New York
    MS-Off Ver
    2011
    Posts
    2

    Counting a range of cells that include text and numbers

    Hey guys,

    So I have been scouring the site looking for help with a particular single-cell formula to count a range of cells that have both text and numbers. Easiest way to explain is with an example:

    SalesID 10
    SalesID 13
    SalesID 17
    SalesID 21
    SalesID 28
    SalesID 31
    SalesID 32
    SalesID 33
    SalesID 37
    SalesID 38
    SalesID 43
    SalesID 53

    What would be the right formula to find the number of SalesID's in the 30-40 range without separating the numbers from the text into a separate column?

    Thanks in advance for the help!
    Last edited by jbourne21; 08-29-2015 at 04:36 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Counting a range of cells that include text and numbers

    You can use wildcards with COUNTIF, so something like this:

    =COUNTIF(A:A,"SalesID 3*")

    This will, of course, also include SalesID 3 if you have it like that, but not if you have SalesID 03. Similarly if you have any in the 300's, but you can overcome that and the SalesID 3 by using:

    =COUNTIF(A:A,"SalesID 3?")

    so it will only count if there is a single character after the 3.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    08-28-2015
    Location
    New York
    MS-Off Ver
    2011
    Posts
    2

    Re: Counting a range of cells that include text and numbers

    Quote Originally Posted by Pete_UK View Post
    You can use wildcards with COUNTIF, so something like this:

    =COUNTIF(A:A,"SalesID 3*")

    This will, of course, also include SalesID 3 if you have it like that, but not if you have SalesID 03. Similarly if you have any in the 300's, but you can overcome that and the SalesID 3 by using:

    =COUNTIF(A:A,"SalesID 3?")

    so it will only count if there is a single character after the 3.

    Hope this helps.

    Pete
    Hi Pete

    Thank you so much for getting back to me on this. This is much easier than what I was attempting with Right formulas within Countif's and Sumproducts! It was the "?" behind the 3 which I needed. Thanks so much!!

  4. #4
    Registered User
    Join Date
    05-10-2015
    Location
    Ryton
    MS-Off Ver
    Office 2013
    Posts
    49

    Re: Counting a range of cells that include text and numbers

    I have a similar problem
    I wish to count the number of cells which contain only text but all the cells in the range contain a formula and countif seems to be counting these cells as well

    is there a way just to count text cells and ignore empy cells containing the formulas which have not been populated with text yet

  5. #5
    Registered User
    Join Date
    08-22-2015
    Location
    Dhaka
    MS-Off Ver
    office 8
    Posts
    33

    Re: Counting a range of cells that include text and numbers

    1. In B1 put =VALUE(RIGHT(A1,2)) and drug down.
    2. In C1 Put =COUNT(B1:B12)-COUNTIF(B1:B12,"<30")-COUNTIF(B1:B12,">40")

+ 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. Counting text in cells dependant on a date range
    By Netski in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-28-2013, 10:08 AM
  2. Counting the # of Unique Text cells in a range
    By peter_f in forum Excel General
    Replies: 2
    Last Post: 10-16-2010, 06:03 AM
  3. adding cells which include numbers and text
    By Shelley in forum Excel General
    Replies: 6
    Last Post: 10-25-2005, 11:05 PM
  4. [SOLVED] Counting Occurrence of Text within Text in Cells in Range.
    By Jeremy N. in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-08-2005, 01:05 AM
  5. Counting unique text/number cells from a range
    By sudeepd12 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-06-2005, 07:05 AM
  6. Counting unique text/number cells from a range
    By sudeepd12 in forum Excel General
    Replies: 3
    Last Post: 06-15-2005, 02:58 PM
  7. Counting unique text/number cells from a range
    By sudeepd12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2005, 07:05 PM

Tags for this Thread

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