+ Reply to Thread
Results 1 to 4 of 4

countif. dates in a year (year is the criteria)

  1. #1
    Registered User
    Join Date
    12-22-2003
    Location
    Texas
    Posts
    90

    countif. dates in a year (year is the criteria)

    I have a table with a column of dates. I's like to use countif or sumif. The criteria I would like to use is simply a year (2010), so any date that falls within that year (2010) would be included in the calculation.

    I'd like to do this without creating a new column for year. In the future, I might want to do a countif and include all dates that are in one month of a year. can the cell function be made to do this?
    Barrfly

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: countif. dates in a year (year is the criteria)

    Try

    =Sumproduct(--(YEAR(A1:A1000)=2010)) for counting

    and


    =Sumproduct(--(YEAR(A1:A1000)=2010),B1:B1000) for summing

    adjust ranges to suit
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: countif. dates in a year (year is the criteria)

    For the year,

    =SUMPRODUCT((1*(YEAR(A1:A100)=2010)))

    for a month as well (eg january)

    =SUMPRODUCT((1*(YEAR(A1:A100)=2010))*(MONTH(A1:A100)=1))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Registered User
    Join Date
    12-22-2003
    Location
    Texas
    Posts
    90

    Re: countif. dates in a year (year is the criteria)

    thanks. works!

+ 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