+ Reply to Thread
Results 1 to 5 of 5

sumif? sumproduct? not sure which...

  1. #1
    Registered User
    Join Date
    07-13-2009
    Location
    Ottawa, Ontario
    MS-Off Ver
    Excel 2003 - SP3
    Posts
    10

    sumif? sumproduct? not sure which...

    I'm trying to get a count of specific cell with specific dates... not exactly sure how to write this formula... Here's what I got.

    Column A Column B

    2012-01-02 Dog
    2012-01-12 Dog
    2012-03-25 Cat
    2012-05-25 Dog


    I need a formula that will count how many Dogs in January.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: sumif? sumproduct? not sure which...

    Try (untested)

    =SUMPRODUCT(--MONTH(A1:A4=1)*(B1:B4="Dog"))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: sumif? sumproduct? not sure which...

    With Excel 2003 SUMPRODUCT is your friend for this. See attached.

    If using Excel 2007 or later, you could use COUNTIFS.

    Rather than hardcode dates into the formula I've added a start and end date cell. This makes it easier when things need updating further down the line.
    Attached Files Attached Files
    If I've been of help, please hit the star

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,610

    Re: sumif? sumproduct? not sure which...

    And, last but not least, use a Pivot Table

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: sumif? sumproduct? not sure which...

    Quote Originally Posted by Special-K View Post
    Try (untested)

    =SUMPRODUCT(--MONTH(A1:A4=1)*(B1:B4="Dog"))
    You should have tested!

    Try it like this:

    =SUMPRODUCT(--(MONTH(A1:A4)=1),--(B1:B4="Dog"))

    Assumes no empty cells in the date column.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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