+ Reply to Thread
Results 1 to 4 of 4

Basic SUMPRODUCT formula question

  1. #1
    Registered User
    Join Date
    03-25-2008
    Posts
    16

    Basic SUMPRODUCT formula question

    After rooting around a bit and looking at some answers given by the folks here who know a lot more about using SUMPRODUCT than I do, I thought I had the correct syntax for what I'm trying to do -- but that is obviously not the case!

    I have a spreadsheet with a "C" column of departments and a "G" column with dates in the format m/dd/yyyy. In the example below, I'm trying to count the number of instances where the "G" column has "1-HR" in it and the date begins with "1/" for January.

    =SUMPRODUCT((DATA!C2:C500="1-HR")*(DATA!G2:G500="1/*"))

    I get zeros for everything.
    Am I'm missing something obvious????

    thanks!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    If you have entered true dates, then you have to break out the Month number a different way...

    Try:

    =SUMPRODUCT((data!C2:C500="1-HR")*(MONTH(data!G2:G500=1))*(data!G2:G500<>""))

    The last argument, (data!G2:G500<>""), is to ensure it doesn't pick up blank cells as January.
    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 Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Count based on two criteria

    Am I'm missing something obvious????
    Actually, it's not quite so obvious.
    Excel calculates on the contents of a cell....not necessarily the displayed
    value. Also, to Excel, dates are represented as the number of days
    since 31-Dec-1899 (but it can make it look like the cell contents
    are a date).
    1 = 01/01/1900
    39,707 = 09/16/2008

    Try this:
    Please Login or Register  to view this content.
    [EDITED TO ADD THIS FORMULA]
    or....if there may be text in DATA!G2:G500
    try this variation to avoid a #VALUE! error:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Last edited by Ron Coderre; 09-16-2008 at 01:36 PM. Reason: Add an additional formula variation
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    03-25-2008
    Posts
    16
    Awesome....you guys are great!!
    Just have to rest a bit from banging my head against the wall on this one as I was definitely not aware of the date issue-

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sumproduct and Time Question
    By gav0101 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-24-2008, 11:36 PM
  2. Formula question-there are safety checks.
    By Gypsiyee in forum Excel General
    Replies: 6
    Last Post: 06-19-2007, 11:15 AM
  3. Replies: 3
    Last Post: 05-31-2007, 10:47 AM
  4. Sumproduct formula issue
    By nfison in forum Excel General
    Replies: 5
    Last Post: 05-14-2007, 03:49 PM
  5. Countif formula
    By schlicken in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-19-2007, 02:38 AM

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