+ Reply to Thread
Results 1 to 2 of 2

COUNTIFS using year as one criterion

  1. #1
    Registered User
    Join Date
    11-11-2011
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    1

    COUNTIFS using year as one criterion

    I've tried looking at all the prior threads, but nothing seemed to solve this the way I was hoping.

    I've got two columns: A has full dates, and B has one of three events. I wanted to build a table that counts the number of events (in three columns), by years (in rows).

    Yes, the simple way is to create another column and extract the year from the date [Year(A#)], then use COUNTIFS on Columns B & C, and truth be told I've already got my table, but I was looking to see if I could have done it using just the countifs, where one criterion finds the YEAR within the date in column A and the other finds the event in column B.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: COUNTIFS using year as one criterion

    Your profile says Excel 2003, I assume you have a later version to use COUNTIFS.

    You could use the start and end dates of the year, i.e. to count event1 in 2008

    =COUNTIFS(A:A,">="&DATE(2008,1,1),A:A,"<"&DATE(2009,1,1),B:B,"event1")

    or you can use SUMPRODUCT in any version

    =SUMPRODUCT((YEAR(A$2:A$100)=2008)*(B$2:B$100="event1"))
    Audere est facere

+ Reply to Thread

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.6.0 RC 1