+ Reply to Thread
Results 1 to 14 of 14

=sumproduct that counts all instances of a specific month

  1. #1
    Registered User
    Join Date
    01-19-2009
    Location
    Sweden
    MS-Off Ver
    Excel 2016 Office 365
    Posts
    25

    =sumproduct that counts all instances of a specific month

    Hi,
    I have a spreadsheet with =sumproduct. The formula works fine and looks like this:

    =SUMPRODUCT((A1:A500=Elsa)*(B1:B500=Anna)*E1:E500)

    FOr this I have two questions - I just cannot make it work:

    1: This is a basic, ofcourse, but anyway: How do i tell Excel to look in ALL cells in a column, not just - as I have specified - numbers 1-500?

    2: Column C in the spreadsheet is a Dates column. Is it possible to add another variable into the formula, namely "cells in column C, that contain an instance of one specific month"? If we use March as an example, I would like the formula to sum the total number of appearances in column E of "Elsa+Anna during March". Date format is yyyy-mm-dd.

    Thankful for all suggestions

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

    Re: =sumproduct that counts all instances of a specific month

    Are you sure it works?
    This looks better

    =SUMPRODUCT((A1:A500="Elsa")*(B1:B500="Anna")*(E1:E500))

    All cells in a column, this will be SLOWWWWWWW, you should use row numbers to limit the calculation and thus speed it up.
    =SUMPRODUCT((A:A="Elsa")*(B:B="Anna")*(E:E))

    Using a month
    =SUMPRODUCT((A:A="Elsa")*(B:B="Anna")*(MONTH(C:C)=3)*(E:E))
    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
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: =sumproduct that counts all instances of a specific month

    Try

    =SUMPRODUCT((A1:A500=Elsa)*(B1:B500=Anna)*(MONTH(C1:C100)=3)*(E1:E500))


    For SUMPRODUCT do not use whole columns: better to use dynamic named ranges for each column

    OR

    use SUMIFS

    =SUMIFS(E:E,A:A,"Elsa",B:B,"Anna",C:C,">=" & $D$2,C:C,"<=" & EOMONTH($D$2,0))

    where D2= 2017/03/01 (First of selected month)

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: =sumproduct that counts all instances of a specific month

    Hi John,

    I was going in your direction until I saw the OP was using 2003 Excel. I don't think the "IFS" were in that older version of excel.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: =sumproduct that counts all instances of a specific month

    Hi All

    Not sure: Excel 2003 do not accept indefinite ranges as A:A.

    Sumproduct should be the only resource
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  6. #6
    Registered User
    Join Date
    01-19-2009
    Location
    Sweden
    MS-Off Ver
    Excel 2016 Office 365
    Posts
    25

    Re: =sumproduct that counts all instances of a specific month

    Thanks for the quick reply!

    However, I tried to simplify the formula - maybe I made it too simple ... This is the actual formula (in Swedish).

    Couldn't make the MONTH work, though, not with Swedish MÅNAD either.

    =PRODUKTSUMMA((owssvr!A2:A504=A9)*(owssvr!B2:B504=B1)*owssvr!E2:E504)


    Also, I have not changed the Excel version, it seems - i use 2016. Sorry for all the mistakes.
    Last edited by nils_sverker; 03-23-2017 at 11:47 AM.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: =sumproduct that counts all instances of a specific month

    Use SUMIFS.


    P.S. Didn't spot the 2003 but as it was incorrect ....

  8. #8
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: =sumproduct that counts all instances of a specific month

    Tack för att dela återkoppling


    (thanks to Google traslator)

  9. #9
    Registered User
    Join Date
    01-19-2009
    Location
    Sweden
    MS-Off Ver
    Excel 2016 Office 365
    Posts
    25

    Re: =sumproduct that counts all instances of a specific month

    Works perfect now, thanks!

    =PRODUKTSUMMA((owssvr!A2:A504=A9)*(owssvr!B2:B504=B1)*(MÅNAD(owssvr!C2:C504)=3)*owssvr!E2:E504)

  10. #10
    Registered User
    Join Date
    01-19-2009
    Location
    Sweden
    MS-Off Ver
    Excel 2016 Office 365
    Posts
    25

    Re: =sumproduct that counts all instances of a specific month

    So ..... if I instead would like to count all the days of March that appear in one row, is that possible.
    That is:
    Column C shows start date, column D shows end date.
    If C is in March, and D is in April, is it possible to sum the March days in a formula? But also, if C is in March, and D also is in March, sum all the days from start to end ...?
    In the same formula as above?
    The E column is of no interest in this matter, I suppose, since it is a manually entered number "days from start to end".

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: =sumproduct that counts all instances of a specific month

    So if C=10/3/2017 and D=24/3/2017 is the result (24/03/2017-10/3/2017) =14 (or 15 if inclusive) ?.

    or

    if C=10/03/2017 and D=05/04/2017 is the result (31/03/2017-10/03/2017) =21 (or 22 if inclusive) ?.

  12. #12
    Registered User
    Join Date
    01-19-2009
    Location
    Sweden
    MS-Off Ver
    Excel 2016 Office 365
    Posts
    25

    Re: =sumproduct that counts all instances of a specific month

    Thanks for the reply John,
    and yes, like your example (including both first and last date).
    A tweek of this would also be if weekends (Sat, Sun) could be omitted, but I doubt that is possible


    Quote Originally Posted by JohnTopley View Post
    So if C=10/3/2017 and D=24/3/2017 is the result (24/03/2017-10/3/2017) =14 (or 15 if inclusive) ?.

    or

    if C=10/03/2017 and D=05/04/2017 is the result (31/03/2017-10/03/2017) =21 (or 22 if inclusive) ?.

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: =sumproduct that counts all instances of a specific month

    Without seeing your file, use a "helper" column:

    You could use NETWORKDAYS.INTL to calculate working days:

    e.g

    =NETWORKDAYS.INTL(MAX(A2,A1),MIN(B2,B1))

    or

    =NETWORKDAYS.INTL(MAX(A2,A1),MIN(B2,EOMONTH(A1,0)))


    A1= 01/03/2017

    B1=31/03/2017

    A2=Start date

    b2=End date

    Then use SUMIFS/SUMPRODUCT to get total working days in MARCH (excluding weekends)

  14. #14
    Registered User
    Join Date
    01-19-2009
    Location
    Sweden
    MS-Off Ver
    Excel 2016 Office 365
    Posts
    25

    Re: =sumproduct that counts all instances of a specific month

    Thanks, I'll give it a try!

+ 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. [SOLVED] Sumif/Sumproduct based on Specific dates occurring in any given month
    By Kandy1084 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-11-2015, 03:08 PM
  2. [SOLVED] Sumproduct formula counts blank cells as instances
    By dlee959 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-24-2014, 01:37 PM
  3. Help with SUMPRODUCT and IF counts.
    By Greg09Ag in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-22-2013, 11:53 AM
  4. [SOLVED] Excel 2007 : Counting the number of instances in a specific month
    By Dutch01 in forum Excel General
    Replies: 6
    Last Post: 06-03-2012, 03:25 PM
  5. Sumproduct, specific month
    By Luth6322 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-19-2010, 02:53 AM
  6. How to perform counts on word instances within Excel 2007
    By tom_moorhouse in forum Excel General
    Replies: 2
    Last Post: 10-13-2009, 11:48 AM
  7. SUMPRODUCT counts 1 (Jan) even when cell is blank
    By zackary68 in forum Excel General
    Replies: 4
    Last Post: 08-06-2008, 02:07 PM

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