+ Reply to Thread
Results 1 to 8 of 8

need help with conditional SUMIF

  1. #1
    Forum Contributor
    Join Date
    02-05-2013
    Location
    Oklahoma City, Oklahoma
    MS-Off Ver
    Excel for Mac 2024
    Posts
    142

    need help with conditional SUMIF

    I have a four-column database with 1252 records, where column A denotes dates, column B denotes quantity, column C denotes unit price, and column D denotes total sale (= column B X column C).

    I need to sum all entries in column D that correspond to all entries in column A within a particular month.

    In other words, I need to sum total sales for the month of January, February, etc in successive rows. Some months contain many records, where other months contain very few.

    See cells D1257 thru D1262

    I tried using the =SUMIFS function but that did not work.

    Please HELP!

    Thank you!
    Attached Files Attached Files
    Last edited by okcsteve; 09-03-2019 at 11:46 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: need help with conditional SUMIF

    Try this, copied down as needed...
    =SUMIFS($D$2:$D$1253,$A$2:$A$1253,">="&A1257,$A$2:$A$1253,"<"&EDATE(A1257,1))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: need help with conditional SUMIF

    Pivot Table is the easiest method.
    Attached Files Attached Files


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Forum Contributor
    Join Date
    04-15-2015
    Location
    beirut
    MS-Off Ver
    2010
    Posts
    107

    Re: need help with conditional SUMIF

    See Please this file
    using for this formula 1==>> jan 2===> Feb etc...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: need help with conditional SUMIF

    Quote Originally Posted by salim ali View Post
    See Please this file
    That is a very good way to do this, except that you are hard-coding the month - consider using the same approach to extract the month from then criteria dates?

  6. #6
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,783

    Re: need help with conditional SUMIF

    G
    H
    1
    Jan-19
    77810
    2
    Feb-19
    11736
    3
    Mar-19
    48684
    4
    Apr-19
    21934
    5
    May-19
    49726
    6
    Jun-19
    19765
    7
    Jul-19
    17336
    8
    Aug-19
    0
    9
    Sep-19
    0
    10
    Oct-19
    0
    11
    Nov-19
    0
    12
    Dec-19
    0


    H1=IF($G1<>"",SUMPRODUCT((MONTH($A$2:$A$2000)=MONTH($G1))*(YEAR($A$2:$A$2000)=YEAR($G1))*($D$2:$D$2000)*($A$2:$A$2000<>"")),"")

    copy down

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: need help with conditional SUMIF

    Just a quick side-note that SP's tend to be far less efficient that SUMIFS in cases like this, especially if the data set grows to be in the 1000's

  8. #8
    Forum Contributor
    Join Date
    02-05-2013
    Location
    Oklahoma City, Oklahoma
    MS-Off Ver
    Excel for Mac 2024
    Posts
    142

    Re: need help with conditional SUMIF

    Works like a charm! Thank you so much!

    How do I now give you credit for solving the post? This part is never intuitive to me since I don't get on here often. Perhaps the site could be designed to make this easier?
    Last edited by okcsteve; 09-04-2019 at 12:42 PM.

+ 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. sumif / conditional sum
    By asrivera in forum Excel General
    Replies: 7
    Last Post: 02-05-2019, 04:13 AM
  2. [SOLVED] Conditional sum or Sumif?
    By Trevasaurus in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-23-2013, 02:09 PM
  3. SUMIF with conditional
    By ERoemer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-08-2013, 01:46 PM
  4. Conditional SUMIF()
    By jcsmfg in forum Excel General
    Replies: 13
    Last Post: 01-13-2010, 12:42 AM
  5. Conditional SUMIF
    By Savitri in forum Excel General
    Replies: 2
    Last Post: 10-07-2009, 07:57 PM
  6. [SOLVED] Conditional sumif
    By wilson@irco in forum Excel General
    Replies: 3
    Last Post: 03-07-2006, 06:25 PM
  7. conditional sumif
    By steph in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-01-2006, 07:40 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