Results 1 to 9 of 9

Thread: Count function

  1. #1
    Join Date
    Nov 2003
    Posts
    5

    Unanswered: Count function

    One of the formulas in excel help =COUNT(A2:A8,2) that is to count the number of cells that contain numbers in the list A2:A8, and the value 2 dosen't work. Does anyone know why?

  2. #2
    Join Date
    Oct 2003
    Posts
    1,091
    The count function looks at values. The first value you have is A2:A8, the second value you have is 2. Therefore, it will count however many numbers are in A2:A8, then add one more, because 2 is a number.

    If you want to count just the numbers in A2:A8, then use

    =COUNT(A2:A8)
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    Nov 2003
    Posts
    5

    Count Function

    That seems to be what it does I thought it counted how may times the value 2 appeared. Why would you want to use this formula if all it counted is one extra number? Below is the example in help.

    A
    1 Data
    2 Sales
    3 12/8/2008
    4
    5 19
    6 22.24
    7 TRUE
    8 #DIV/0!

    Formula Description (Result)
    =COUNT(A2:A8) Counts the number of cells that contain numbers in the list above (3)
    =COUNT(A5:A8) Counts the number of cells that contain numbers in the last 4 rows of the list (2)
    =COUNT(A2:A8,2) Counts the number of cells that contain numbers in the list, and the value 2 (4)

  4. #4
    Join Date
    Oct 2003
    Posts
    1,091
    Okay, that is a different function. Then you would use:

    =COUNTIF(A2:A8,2) which counts the number of times that the number 2 appears in the list.

    In this case, A2:A8 is the range, and 2 is the criteria.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  5. #5
    Join Date
    Nov 2003
    Posts
    5
    Thanks I understand it now and my question is why would you use the formula that they used in help =COUNT(A2:A8,2) Counts the number of cells that contain numbers in the list, and the value 2 (4)?

  6. #6
    Join Date
    Oct 2003
    Posts
    1,091
    It still makes sense that a range of cell values and a specific value put into the COUNT function cause the function to operate correctly. That is, it is not counting the number of times that 2 occurs. It is rather counting the numbers in that range plus another number, that happens to be 2.

    Thus,

    =COUNT(A2:A8,2,14,29), if cells in A2:A8 each have a number, this formula would return the result: 10 (7 numbers in the range, plus 3 numbers specifically named).
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  7. #7
    Join Date
    Nov 2003
    Posts
    5
    Thanks again I understand exactly how it works now. I am just trying to think of an application where you would use it and can't. Can you? Thanks for your help!

  8. #8
    Join Date
    Oct 2003
    Posts
    1,091
    I think most realistically it would come in handy if you had multiple, non-contiguous ranges.

    =COUNT(A2:A8,C4:J4,K6:K12)
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  9. #9
    Join Date
    Nov 2003
    Posts
    5
    I agree but there seems to be little use for the example in help just made things confusing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •