+ Reply to Thread
Results 1 to 18 of 18

How to fix EOMONTH in SUMIFS

  1. #1
    Registered User
    Join Date
    10-30-2019
    Location
    Bucharest
    MS-Off Ver
    365 ProPlus
    Posts
    15

    How to fix EOMONTH in SUMIFS

    Hello!

    I`m trying to workout a formula that adds values from Col A, if two criteria are met.

    Crit. 1: Value is between Start Date and End Date.

    Crit. 2: Value is from specified Month in fixed cell.

    I`m now working with:

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


    ...but it only works some of the time and it does`t seem to always update to changes in the table.

    The table I work with has thousands of entries and quite a lot of subtotals. Also, columns A (values) and column B (Start-Stop Date) have blanks in some cells.

    I think that the problem is with the <="&EOMONTH part, because most of the time values seem to be added regardless of the specified month.

    Alternative: Is there another formula besides SUMIFS that would be better suited here? I understand SUMIFS has some problems working with 3 columns.

    I`m attaching a small table with data from the main. Highlighted area holds the problematic formula.
    Attached Files Attached Files

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: How to fix EOMONTH in SUMIFS

    That's because you compare dates with a number(29,30 or 31). It needs to be a date:
    =SUMIFS(A:A,C:C,">="&F5,C:C,"<="&DATE(YEAR($F$5),MONTH($F$5),EOMONTH(F5,0)))
    Click the * to say thanks.

  3. #3
    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,869

    Re: How to fix EOMONTH in SUMIFS

    What date are you expecting this to return?

    EOMONTH(F5;0)

    It returns 30/09/2019.

    Anything less than this date (including dates in August) will be included.
    Last edited by AliGW; 10-30-2019 at 07:08 AM.
    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.

  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: How to fix EOMONTH in SUMIFS

    01-08-2019 is less or equal 30-09-2019 so that why you've got difference equal of line with 01-08-2019 in C.
    If I am correctly read you needs you want to create criteria for col C not less than end of month but IN month.
    Sum all between dates (in B) which have req. month in C (01/09 - 30/09). Am I right?
    Maybe try like (I18):

    Please Login or Register  to view this content.
    Last edited by KOKOSEK; 10-30-2019 at 07:16 AM.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  5. #5
    Registered User
    Join Date
    10-30-2019
    Location
    Bucharest
    MS-Off Ver
    365 ProPlus
    Posts
    15

    Re: How to fix EOMONTH in SUMIFS

    Hi!
    Maybe it would be better to explain exactly what this is for:

    Col A is Invoice value
    Col B is Date invoice arrived
    Col C is Invoice Date

    What I need from the formula is to SUM values of the invoices from September 2019 [F5] that have arrived between the dates in G18 and G19.
    Both F5 and G18:G18 are subject to change.

    So what I have until now is just G18:G19 doing OK, but not SUM-ing values from just F5 - September 19.

    I hope it`s clearer now.

    Thank you!

  6. #6
    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,869

    Re: How to fix EOMONTH in SUMIFS

    No, you need to read the comments made and act upon them!

    =SUMIFS(A:A;B:B;">="&G17;B:B;"<="&G18;C:C;"<="&EOMONTH(F5;0))

    The section in red in your formula is looking for dates less than or equal to 30/09/2019 - this means it will include dates in August in that column (C).

    In other words, the formula is returning what you are asking it to return.

    Read the various comments above about how to get round this.

  7. #7
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: How to fix EOMONTH in SUMIFS

    tRY

    =SUMIFS(A:A,B:B,">="&G18,B:B,"<="&G19,C:C,">="&EOMONTH(F5,-1)+1,C:C,"<="&EOMONTH(F5,0))

    Result must be 297178.56
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  8. #8
    Registered User
    Join Date
    10-30-2019
    Location
    Bucharest
    MS-Off Ver
    365 ProPlus
    Posts
    15

    Re: How to fix EOMONTH in SUMIFS

    Tested using KOKOSEK`s formula and it seams to be working like it should. I got trapped at the &EOMONTH part and didn`t think it through.
    Thank you all for your quick responses. Saved me a lot of headache!
    Havea great day!

  9. #9
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: How to fix EOMONTH in SUMIFS

    You welcome. Happy to help.
    Thanks for rep.

  10. #10
    Registered User
    Join Date
    10-30-2019
    Location
    Bucharest
    MS-Off Ver
    365 ProPlus
    Posts
    15

    Re: How to fix EOMONTH in SUMIFS

    Hello again!

    I know I`m just being lazy right now ... but:
    Is there any way I can combine the two formulas below?

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

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


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


    Your formula works great but I`m trying to get it to work on some other stuff that needs more criteria.
    Basically, I need it to do all it does now, but this time take into account another two columns [E and C].
    The criteria for this new one is: SUM F:F according to 1st formula but skip rows if CC=107382 and EE <> 21,22,40 or 24.

    PS: Second formula was a True / False scenario so I don`t know if it can work with the first one.

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


    Thank you so very much!
    Attached Files Attached Files

  11. #11
    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,869

    Re: How to fix EOMONTH in SUMIFS

    This is a new query - please start a new thread with an appropriate title that refers to joining formulae.

  12. #12
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: How to fix EOMONTH in SUMIFS

    The correct result would be 198, not 363, because you have 107382 in column C,row 15. Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    10-30-2019
    Location
    Bucharest
    MS-Off Ver
    365 ProPlus
    Posts
    15

    Re: How to fix EOMONTH in SUMIFS

    Hi, AliGW! I din`t think it necessary since it relates to the same formula. Hope it`s not a problem.

    PaulM100. If 107382 = 21, 22,40 or 24 the formula should SUM. Only if C:C = 107382 and E:E differs from the 3 values, the formula should skip.

    Thanks!

  14. #14
    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,869

    Re: How to fix EOMONTH in SUMIFS

    OK - leave it this time. Bear my advice in mind in future, please.

  15. #15
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: How to fix EOMONTH in SUMIFS

    Simplest way wold be:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    10-30-2019
    Location
    Bucharest
    MS-Off Ver
    365 ProPlus
    Posts
    15

    Re: How to fix EOMONTH in SUMIFS

    AliGW - I`ll keep that in mind. Thank you!

    PaulM100 - Seams to work but I`ll have to test it on the big table. Thank you very much and I owe you a beer!

  17. #17
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: How to fix EOMONTH in SUMIFS

    Here is another possibility:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    10-30-2019
    Location
    Bucharest
    MS-Off Ver
    365 ProPlus
    Posts
    15

    Re: How to fix EOMONTH in SUMIFS

    Hello, PaulM100!
    Sorry for the delay but I was AFK over the weekend.
    Your 1st formula does the job perfectly, so there is no need to test the second one.
    I`m hoping to manage and butcher it to do a COUNT using the same criteria, but for now, all is well.
    Thanks again!

+ 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. EOMONTH Date + 1
    By marcygiff in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-05-2018, 11:39 AM
  2. Eomonth ?
    By wwmcguire in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-18-2018, 09:59 AM
  3. [SOLVED] sumifs using eomonth
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-12-2017, 09:10 AM
  4. EOMONTH Help !!!!
    By amitzala in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2013, 05:39 AM
  5. I'm having problems with EOMONTH
    By Ronni T. Vasquez M. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  6. [SOLVED] I'm having problems with EOMONTH
    By Ronni T. Vasquez M. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  7. [SOLVED] I'm having problems with EOMONTH
    By Ronni T. Vasquez M. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM

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