+ Reply to Thread
Results 1 to 13 of 13

SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

  1. #1
    Registered User
    Join Date
    11-25-2015
    Location
    na
    MS-Off Ver
    2010
    Posts
    24

    SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    Dear All

    I have attached a spreadsheet I am currently working on. I have a list of dates and a list of revenue. I would like to use a SUMIF formula to total up the revenue for specific months, however it goes slightly further then this. I have listed the month buckets I require in A2:D7.

    B2 - I need the sum of all revenues that are prior to todays month (i.e before march), please note that I want to use the today function so that the formula can be future proof i.e in April it will automatically total all fees prior to april, without me having to edit the formula.
    D2 - will show the sum of all revenues in March (todays month) I have already tried using the formula: =SUMIF(D9:D1000,">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1),E9:E1000)-SUMIF(D9:D1000,">"&DATE(YEAR(TODAY()),MONTH(TODAY())+1,1),E9:E1000)
    however this sum of 2,576 does not reconcile with the sum i get of 2,270 when adding manually.
    D3 - will show the sum of all revenues in the NEXT (April) month i.e todays month +1 month
    D4 - will show the sum of all revenues in the SECOND NEXT (May) month i.e todays month +2 month

    The rest of the buckets are self explanatory, sum of all fees between june and august in D5. D6 will show the sum of all revenues in august onwards.

    If you could populate the table and re-attach that will be a great help.

    Please let me know if you have any other questions.

    Thanks,
    AK
    Attached Files Attached Files

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    try
    =SUMIFS(E9:E1000,D9:D1000,">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1),D9:D1000, "<="&EOMONTH(TODAY(),0))

    Next month
    =SUMIFS($E$9:$E$1000,$D$9:$D$1000,">="&DATE(YEAR(TODAY()),MONTH(TODAY())+1,1),$D$9:$D$1000, "<="&EOMONTH(TODAY(),1))

    Month after next
    =SUMIFS($E$9:$E$1000,$D$9:$D$1000,">="&DATE(YEAR(TODAY()),MONTH(TODAY())+2,1),$D$9:$D$1000, "<="&EOMONTH(TODAY(),2))
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    11-25-2015
    Location
    na
    MS-Off Ver
    2010
    Posts
    24

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    Thanks ETAF. Those work great. Is it possible for anyone to complete the rest of the date buckets.

    1)Past due date - before todays month
    2) June - August - I have used =SUMIFS($M$9:$M$1000,$J$9:$J$1000,">="&DATE(YEAR(TODAY()),MONTH(TODAY())+3,1),$J$9:$J$1000, "<="&EOMONTH(TODAY(),3))+SUMIFS($M$9:$M$1000,$J$9:$J$1000,">="&DATE(YEAR(TODAY()),MONTH(TODAY())+4,1),$J$9:$J$1000, "<="&EOMONTH(TODAY(),4))+SUMIFS($M$9:$M$1000,$J$9:$J$1000,">="&DATE(YEAR(TODAY()),MONTH(TODAY())+5,1),$J$9:$J$1000, "<="&EOMONTH(TODAY(),5))
    for this which seems to work however if there is a simpler version would be helpful to understand.
    3) August + - i.e anything after august

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    june to august
    OR
    3 months from todays date to 5 mths
    =SUMIFS($M$9:$M$1000,$J$9:$J$1000,">="&DATE(YEAR(TODAY()),MONTH(TODAY())+3,1),$J$9:$J$1000, "<="&EOMONTH(TODAY(),5))
    you dont need to do each month - just from 1st of 1st month to end of last month
    in this case 3 months from today() to end of 5 mths from today

    anything from 6 months would be
    =SUMIF($J$9:$J$1000,">="&DATE(YEAR(TODAY()),MONTH(TODAY())+6,1), $M$9:$M$1000)

  5. #5
    Registered User
    Join Date
    11-25-2015
    Location
    na
    MS-Off Ver
    2010
    Posts
    24

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    Thanks ETAF. June - August works great however August onwards seems to be giving me an incorrect value. Would it be possible to populate the spreadsheet so I can get a better look?

    Also what about the past due date bucket?

    Thanks again!

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    Added to the sheet
    Also changed the month text to use today as well, so that changes as weel

    I have not checked the numbers yet
    Attached Files Attached Files

  7. #7
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    I have tried using different method to check numbers
    here

    looks all oK
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-25-2015
    Location
    na
    MS-Off Ver
    2010
    Posts
    24

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    Thank you so much for all your help it is greatly appreciated!

  9. #9
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    you are welcome, thanks for the rep

  10. #10
    Registered User
    Join Date
    11-25-2015
    Location
    na
    MS-Off Ver
    2010
    Posts
    24

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    One last point, i'd like to replace =Today() within the formula to a cell reference which will contain a date within it. i.e cell A2 will have a date, rather then having TODAY, it will point to the cell with a date. I've tried but excel doesnt seem to accept my formula.

  11. #11
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    should work fine
    just add the date into cell a2 and then replace the value today() for that cell reference

    I have just used H1 cell
    and replaced today() with $H$1 in the formulas on D2 to D6

    and tested for any date this month and the result is the same an also works for next month

    what happens when you change all the today() to the cell ?
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    11-25-2015
    Location
    na
    MS-Off Ver
    2010
    Posts
    24

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    works great thanks so much

  13. #13
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month

    you are welcome

+ 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] Dynamic formula to calculate the difference between current and previous month
    By kay007 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-19-2015, 11:19 AM
  2. VBA code adjustment to include only current month and previous month automatically.
    By ElmerFud in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-05-2015, 03:02 PM
  3. [SOLVED] Formula issue for Current/Previous month Date
    By hecgroups in forum Excel General
    Replies: 3
    Last Post: 03-01-2014, 06:41 AM
  4. [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
  5. Macro using vlookups comparing 2 months paysheet(previous month and current month)
    By srinivasan1965 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2012, 03:45 AM
  6. Replies: 5
    Last Post: 10-04-2012, 07:06 AM
  7. [SOLVED] VBA to identify the current month and previous month based on system date
    By ravikumar00008 in forum Excel General
    Replies: 10
    Last Post: 07-26-2012, 10:04 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