+ Reply to Thread
Results 1 to 9 of 9

SUMIFS not working when using cell references instead of dates

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    Hereford
    MS-Off Ver
    Excel 2010
    Posts
    11

    SUMIFS not working when using cell references instead of dates

    I am attaching a small example file demonstrating my problem.

    In cell D30 I have:
    =SUMIFS(E3:E27,B3:B27,">=1/1/2021",B3:B27,"<=31/1/2021")
    This returns the result I expect, a sum total of E7:E19, being between the dates 1/1/21 and 31/1/21 in column B.

    In cell D31 I have:
    =SUMIFS(E3:E27,B3:B27,">="&B30,B3:B27,"<="&B31)
    This returns 0.

    The dates in cells B30 and B31 are the results of formulas, =DATE(YEAR(TODAY()),MONTH(TODAY()),1) and =DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)-1.
    Dates are formatted as dates.

    I cannot understand why the formula using cell references won't work as I expect it to.
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: SUMIFS not working when using cell references instead of dates

    Unfortunately you need to format the dates when concatenating with >, <= etc.

    =SUMIFS(E3:E27,B3:B27,">="&TEXT(B30, "dd/mm/yyyy"),B3:B27,"<="&TEXT(B31, "dd/mm/yyyy"))
    If posting code please use code tags, see here.

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,910

    Re: SUMIFS not working when using cell references instead of dates

    You've got the Lotus transition formula evaluation turned on for the sheet. Turn it off (bottom of the Advanced section in Excel options) and your formula works fine.
    Rory

  4. #4
    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: SUMIFS not working when using cell references instead of dates

    Hi

    It's a File Settings issue. Note that when you test the dates in column B with =ISNUMBER(B31) the function returns a 1 rather than the normal TRUE

    Go to File _ Options _Advanced and scroll right to the bottomdown and un-check 'Transition Formula Evaluation' and also un-check 'Transition formula entry.

    I've not encountered that odd behaviour before. Obviously Excel can't make the connection between a 1 and True in this context.
    Is it an old workbook that predates Excel 2000 when =ISNUMBER() was introduced and presumably some change associated with evaluating numbers as True?
    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.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: SUMIFS not working when using cell references instead of dates

    Well that's a new one to me.

  6. #6
    Registered User
    Join Date
    08-06-2012
    Location
    Hereford
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: SUMIFS not working when using cell references instead of dates

    Quote Originally Posted by rorya View Post
    You've got the Lotus transition formula evaluation turned on for the sheet. Turn it off (bottom of the Advanced section in Excel options) and your formula works fine.
    Spot on Rorya. I never would have spotted this. It's a personal finance file that I used to keep on a floppy last century. It was probably originally created in Lotus 123.
    Thank you.

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,910

    Re: SUMIFS not working when using cell references instead of dates

    The problem arises because that setting prevents you from concatenating text and numbers, so the criterion ">="&B30 actually evaluates to #VALUE! (and the same for the other one), and nothing matches those criteria as there aren't any #VALUE errors in the date column.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: SUMIFS not working when using cell references instead of dates

    Thanks, Guys... I've used cell refs for dates in SUMIFS for... well, forever. I was sitting here in total bewilderment at its refusal to add up here.

    Codenumpty... if you REALLY want to make youself feel old, you could refer to "last millenium" instead!!
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  9. #9
    Registered User
    Join Date
    08-06-2012
    Location
    Hereford
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: SUMIFS not working when using cell references instead of dates

    Quote Originally Posted by rorya View Post
    The problem arises because that setting prevents you from concatenating text and numbers, so the criterion ">="&B30 actually evaluates to #VALUE! (and the same for the other one), and nothing matches those criteria as there aren't any #VALUE errors in the date column.
    I saw the #VALUE when I tried to evaluate the formula, forgot to mention that. I would have had to give up on that one.

+ 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] SUMIFS Formula with Dates Not Working
    By Pooger in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 02-20-2020, 03:36 PM
  2. Replies: 5
    Last Post: 03-30-2016, 06:01 AM
  3. [SOLVED] Sumifs with OR/AND array using cell references
    By baijixu in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-19-2015, 11:04 AM
  4. [SOLVED] SUMIFS formula not working with Dates
    By Bigred25 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-11-2014, 10:25 AM
  5. Sumifs between Dates not working
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2013, 05:47 AM
  6. Help with SUMIFS w/o using mathematical signs--only cell references
    By mkhaccount in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-25-2012, 01:27 AM
  7. sumifs with dates not working
    By paualou76 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-30-2011, 08:33 PM

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