+ Reply to Thread
Results 1 to 3 of 3

Thread: Count in Range.

  1. #1
    Registered User
    Join Date
    01-13-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    1

    Count in Range.

    Can anyone please tell me how to count in a range?

    For example, in a data set, how to count all the values between 3.5 and 5.6

    Many Thanks.

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Count in Range.

    You could use SUMPRODUCT

    Code:
    =SUMPRODUCT(--(range>=3.5),--(range<=5.6))
    (substitute "range" with your actual range address)

    Or you could use 2 COUNTIFs

    Code:
    =COUNTIF(range,">=3.5")-COUNTIF(range,">5.6")
    or... written another way

    Code:
    =SUM(COUNTIF(range,{">=3.5",">5.6"})*{1,-1})
    Of course if 3.5 and 5.6 are themselves variables you would need to adjust accordingly (the final option of the three outlined would in effect become void)

    Those using XL2007 & beyond would use COUNTIFS

  3. #3
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,740

    Re: Count in Range.

    Just to mention that you can put references instead of number (for example A1 and A2 instead of 3.4 and 5.1)

    Another solution:

    =SUMPRODUCT(--(ABS($D$1:$D$32-($A$1+$A$2)/2)<=($A$2-$A$1)/2))

    comfirmed with ctrl+shift+enter

    where A1 and A2 are references and D1:D32 is range
    "Relax. What is mind? No matter. What is matter? Never mind!"

Thread Information

Users Browsing this Thread

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

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.2.0