+ Reply to Thread
Results 1 to 7 of 7

Sumif formula with current month as criteria

  1. #1
    Registered User
    Join Date
    03-08-2018
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    Sumif formula with current month as criteria

    Hi,

    Need help fixing my formula I am trying to calculate all my monthly expenses from different sheets in my workbook the formula i have for just my normal transactions but I would like to sum my CC if applies to that month and category of my budget.

    =SUMIF(Transactions!$E$6:$E$254,'Monthly Expense'!B15,Transactions!$D$6:$D$254)+SUMIF(JoeExpenseScheels[Category],'Monthly Expense'!B15,JoeExpenseScheels[Amount])

    I have a date column "C" in that sheet, I also just have the month and year in the Monthly Expense sheet B3 and B4

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,394

    Re: Sumif formula with current month as criteria

    Can you attached a "dummy" of the workbook, as the description is rather confusing?

    For activity in a date range, the formula is
    =sumifs(Values,Date range,">="&(Date),Date range,"<="&(EOMONTH(date),Categories,chosen Category)
    (i.e. Sum all values for whatever category, where the transaction date is between the selected date and the end of that month).

    Ochimus

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Sumif formula with current month as criteria

    Something like

    =SUMIFS(Transactions!$D$6:$D$254,Transactions!$E$6:$E$254,'Monthly Expense'!B15,Transactions!$C$6:$C$254,">="&DATE('Monthly Expense'!B4,'Monthly Expense'!B3,1),Transactions!$C$6:$C$254,"<="&EOMONTH(DATE('Monthly Expense'!B4,'Monthly Expense'!B3,1),0))

    That's just the first half of your formula, same method applies to the second part.

  4. #4
    Registered User
    Join Date
    03-08-2018
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    Re: Sumif formula with current month as criteria

    Here is a sample of my workbook, I need the sumif formula on sheet "Monthly Expense" under actual column
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,394

    Re: Sumif formula with current month as criteria

    TheTallOne,

    Your Card sheets have a common layout, so you can combine them in one "3D Reference", as shown on the update to your workbook attached, rather than calculating each one individually:

    =SUMIF(Transactions!$E$6:$E$200,'Monthly Expense'!B6,Transactions!$D$6:$D$200)+SUMPRODUCT(SUMIF(INDIRECT("'"&SHEETS&"'!"&"B6:B200"),B6,INDIRECT("'"&SHEETS&"'!"&"D6:D200")))

    and copied down against each catagory in the Transaction sheet.

    "Sheets" is the range of the Card sheet names created in Col J

    You can test it by creating some "dummy" entries on the cards using the expense catagories in the Transaction sheet, as you can see I did with the two "rents".

    Credit goes to www.extendoffice.com where I found it.

    Hope this helps

    Ochimus
    Attached Files Attached Files
    Last edited by Ochimus; 10-23-2018 at 09:36 PM.

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Sumif formula with current month as criteria

    It looks like Ochimus misinterpreted your sample data, the relevant data in the transactions sheet also has the same layout as the card sheets, so no need to add that one separately, if you're going to use the 3d method then might as well do it all that way.

    While I was tracing the formulas and named ranges to see if there was a 'proper' date anywhere that could be used, I found that your named range, 'Year' refers back to =YEAR(TODAY()) which I have replaced with the actual year, 2018. Using TODAY() will give you bad results if, for example you try to view December 2018 data in January 2019.

    In the attached file, I've amended the named range, 'SHEETS' that Ochimus added, to include the Transactions sheet, also added 2 new defined names, Month_Start and Month_End to give the start and end of the month specified in the cash flow sheet.

    Finally, I've updated the formulas in D6:D20 to include the changes above.

    =SUMPRODUCT(SUMIFS(INDIRECT("'"&SHEETS&"'!"&"D6:D200"),INDIRECT("'"&SHEETS&"'!"&"E6:E200"),B6,INDIRECT("'"&SHEETS&"'!"&"C6:C200"),">="&Month_Start,INDIRECT("'"&SHEETS&"'!"&"C6:C200"),"<="&Month_End))
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-15-2021
    Location
    Colorado
    MS-Off Ver
    2016
    Posts
    4

    Re: Sumif formula with current month as criteria

    Hi,

    I have a very similar situation to the post above. However, I am not able to make the formula work on my end. My worksheets are slightly different. The worksheets are defined as a table.

    Here is the formula that I got to work, but it will only return entries for February 1st and not the entire month. Note that the 1st row in the summary worksheet has a custom date format of mmmm.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Is there a way to get the above formula to return a sum, based on selected category, for the particular month (not just the first day of the month)?

    I cannot get the code from the previous post to work either... I am not sure how it is referencing the date category selected... My modification of the formula produces an error...

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If someone could help troubleshoot either of these formulas, I don't care which one, whatever is easiest, I would be very grateful.

    Here are my images of the spreadsheets, the sub-sheet and the master sheet.

    Card Spreadsheet Example.JPG

    Summary Spreadsheet.JPG



    Thanks!
    Last edited by Gingerbreadgrl; 03-15-2021 at 10:42 AM. Reason: Forgot attachments

+ 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. VBA to calculate AVERAGEIF and SUMIF for current week/month/year
    By lostest in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-21-2016, 07:35 AM
  2. [SOLVED] Set PivotTable Filter to Current Day, Current Week, Current Month, or Current Year
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2014, 08:31 AM
  3. [SOLVED] Formula for amount on previous month based on current month
    By Yu Marquez in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-21-2014, 12:42 AM
  4. Replies: 5
    Last Post: 10-04-2012, 07:06 AM
  5. [SOLVED] sumif formula for date and month with match criteria
    By alimamak in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 08-08-2012, 08:31 PM
  6. Current Month Criteria in SUMIFS
    By vaughn134 in forum Excel General
    Replies: 2
    Last Post: 07-12-2012, 04:57 AM
  7. Current month as criteria in SumIF statement
    By rhudgins in forum Excel General
    Replies: 6
    Last Post: 04-04-2011, 12:01 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