+ Reply to Thread
Results 1 to 8 of 8

Count numbers.

  1. #1
    Registered User
    Join Date
    10-24-2014
    Location
    Iceland
    MS-Off Ver
    2013
    Posts
    9

    Count numbers.

    Hi.

    I have a list in Excel like:

    10
    20
    10
    24
    25
    30
    10 etc. (Hundreds of numbers)

    I need to count how often each numbers comes up.
    But first I need Excel to make me a list of the numbers.
    30
    25
    24
    20
    10


    And then I would use COUNTIF(A1:150;B1)

    All I can think of is the "Large" function but it's not exactly what I need. The numbers are changing from day to day so I would prefer some function for this instead of doing it manually.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    8,016

    Re: Count numbers.

    Why not use a Pivot Table?

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Count numbers.

    I know someone will have a formula for this however in its absence, the following Sub will do what you're after (you'll need to tidy it to find last row etc as this is just rough).

    Please Login or Register  to view this content.
    Last edited by pjwhitfield; 12-29-2014 at 10:00 AM.
    If someone has helped you then please add to their Reputation

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2506
    Posts
    13,792

    Re: Count numbers.

    Assuming your list of numbers is in column A put this in column B and fill down as far as you find adequate:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then in column C this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and fill down as far as adequate.

    Or since your number list is changing I would suggest you create a Dynamic Named Range in Name Manager. I would suggest:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    in the Refers to text box.
    I chose the arbitrary name -- OrignalNums -- and put it in the Name text box.

    Then your formulas would be in column B:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    this would extract unique numbers and sort them in descending order.

    Then in column C:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    to get a count of those unique numbers.
    Example file attached.

    Does this do what you want?
    Attached Files Attached Files
    Last edited by FlameRetired; 12-29-2014 at 03:21 PM.

  5. #5
    Registered User
    Join Date
    10-24-2014
    Location
    Iceland
    MS-Off Ver
    2013
    Posts
    9

    Re: Count numbers.

    Quote Originally Posted by FlameRetired View Post
    Does this do what you want?
    Yes, thank you. This is exactly what I needed. Thank you.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Count numbers.

    You could also use this for the unique values list...
    =IFERROR(INDEX($B$4:$B$1000,MATCH(0,INDEX(COUNTIF($E$4:E4,$B$4:$B$1000),),0)),"")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count numbers.

    If you know the range for the values that you want a count of, you can use the FREQUENCY formula to give a count of each value that is found within that range.

    My example makes the range of possible numbers 1 to 85 which I entered in column C. These values can be entered using the SERIES function of Excel. (Fill, Series) The values to be counted are in A2 to A100. The formula is an array formula which is entered by Ctrl + Shift + Enter.

    Select D2 to D86 and enter this formula.

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


    COUNTIF can also be used: (this is a regular formula entered normally)

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


    If you want to extract the unique values from the data before counting use this ARRAY formula. I entered the formula in G2 and copied down. If you use a different column, change the $g$1:G1 to the column that you want to use. Change the $G$1 and G1 to 1 row above the starting row you have.

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


    Then use the COUNTIF or FREQUENCY formula to count the occurrences.

    The enclosed file has examples of these formulae.

    This is by no means all the ways to do this.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2506
    Posts
    13,792

    Re: Count numbers.

    Quote Originally Posted by bjartmare View Post
    Yes, thank you. This is exactly what I needed. Thank you.
    You're welcome. Glad it helped. 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] Count If Function To Count Frequency Of Long Numbers
    By RowanB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2013, 05:18 AM
  2. Replies: 6
    Last Post: 12-22-2012, 05:04 PM
  3. [SOLVED] Count numbers between two values in a coma delimited string of numbers
    By van23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-10-2012, 11:42 PM
  4. How do i count numbers and letters to find a total count of all
    By Linda in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-10-2005, 12:55 PM
  5. Replies: 0
    Last Post: 08-08-2005, 01:05 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