+ Reply to Thread
Results 1 to 10 of 10

SUM some of the columns by date

  1. #1
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    SUM some of the columns by date

    Hello dear Excel Experts!

    I have the following table
    Capture.PNG

    Is there a formula for summing for the product in multiple columns in the given month?
    I have tried with the formula in the picture but no success
    Hope I have made myself clear....

    Thanks a lot!
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: SUM some of the columns by date

    Rather than an image, please attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: SUM some of the columns by date

    Hi and thank you for the reply!

    I have attached a file.
    If there are still questions please reply.
    Thanks again!
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: SUM some of the columns by date

    In D18, copied across and down:

    =SUMPRODUCT((MONTH($C$4:$C$14)=ROW(D18)-17)*($D$3:$H$3=D$17),$D$4:$H$14)

    You must change the headings in D17-F17 to PROD 1, PROD 2 and PROD 3 to match the main table.
    Last edited by AliGW; 07-30-2016 at 06:27 AM.

  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: SUM some of the columns by date

    Using the ROW function leaves the formula vulnerable to new row insertions. If you were to insert a new row 5 then ROW(D18)-17 becomes ROW(D19)-17 and you miss the result for month 1.

    Using the ROWS function is more robust.

    =SUMPRODUCT((MONTH($C$4:$C$14)=ROWS(D$18:D18))*($D$3:$H$3=D$17),$D$4:$H$14)

    If you were to insert a new row 5 then ROWS(D$18:D18) becomes ROWS(D$19:D19) and it still evaluates to 1.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: SUM some of the columns by date

    Hi,

    Can I suggest you normalise your data and have columns for

    Date
    Prod Number ' values being Prod 1, Prod 2 ..etc
    Value

    Then use a Pivot Table, which is far more flexible and efficient, and group the dates by month.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: SUM some of the columns by date

    Here is another way..
    Enter formula in D18, copy across and down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Please see attached file.
    Attached Files Attached Files
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  8. #8
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: SUM some of the columns by date

    Thank you all for your answers!
    @Richard Buttrey I know that normalising and using PivotTable would be the right choise but unfortunately this is not an option.

    ... and learned another thing also: MONTH(1&$C18)

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: SUM some of the columns by date

    Glad to have helped!

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

    Re: SUM some of the columns by date

    You're welcome. Thanks for the feedback!

+ 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. Replies: 1
    Last Post: 09-30-2015, 09:08 AM
  2. [SOLVED] Generate Dates by Month along columns based on Start Date and End Date
    By Stndsh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2015, 05:32 AM
  3. [SOLVED] Creating a view by filtering 2 columns by date (both within 3 months of today's date)
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-21-2014, 05:04 AM
  4. Replies: 3
    Last Post: 09-26-2012, 09:43 AM
  5. [SOLVED] IF AND or SUMIFS comparing Months from 2 date columns and text from 2 other columns
    By jrochet in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-22-2012, 11:06 AM
  6. Formula for determining if two date columns fall within specific date range
    By Igottabeme in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-20-2006, 09:55 PM
  7. Replies: 1
    Last Post: 04-20-2006, 05:10 PM

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