+ Reply to Thread
Results 1 to 3 of 3

How do I count in a range?

  1. #1
    Registered User
    Join Date
    12-11-2009
    Location
    Luang Prabang, Laos
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    33

    How do I count in a range?

    Hi!

    I know the "countif" formula, but that just apolies for counting single numbers or other entries. But now want to count the occurance of number within a range.So I have a data, including years. What I want is counting how often occurance "X" occurs in a decade (1970-1979). So it should count 1970, 1971, 1972, etc until 1979.

    How do I do that?

    Thanks in advance!

    ADB
    Last edited by ADB; 03-28-2010 at 04:09 AM. Reason: Solved

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: How do I count in a range?

    you can try this:

    =COUNTIF(E1:E28,">=1976")-COUNTIF(E1:E28,">1979")

    or define year in A1:

    =COUNTIF(E1:E28,">="&A1)-COUNTIF(E1:E28,">"&A1+9)

    or by SUMPRODUCT function:

    =SUMPRODUCT(--(E1:E28>=1976),--(E1:E28<=1979))
    Last edited by zbor; 03-28-2010 at 03:21 AM.

  3. #3
    Registered User
    Join Date
    12-11-2009
    Location
    Luang Prabang, Laos
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    33

    Re: How do I count in a range?

    Quote Originally Posted by zbor View Post
    you can try this:

    =COUNTIF(E1:E28,">=1976")-COUNTIF(E1:E28,">1979")

    or define year in A1:

    =COUNTIF(E1:E28,">="&A1)-COUNTIF(E1:E28,">"&A1+9)

    or by SUMPRODUCT function:

    =SUMPRODUCT(--(E1:E28>=1976),--(E1:E28<=1979))
    Excellent, first one works. I guess one should add an extra "=" to calculate a whole decade!

    =COUNTIF(E1:E28,">=1970")-COUNTIF(E1:E28,">=1979")

    Thanks a lot!

    ADB

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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