+ Reply to Thread
Results 1 to 10 of 10

SumIF within date range over multiple months/years

  1. #1
    Registered User
    Join Date
    11-20-2019
    Location
    South Africa
    MS-Off Ver
    MS Office 2010
    Posts
    5

    SumIF within date range over multiple months/years

    Good Day All. I am hoping for some help with regards to SumIF. I have multiple conditions which are working except the sum column between a specific date range. The Formula works if the date range is in the same month but as soon as i expand it to another month the formula goes crazy and only uses the days of the month and ignores the month.

    My formula is as follows: =SUMIFS(K5:K35;A5:A35;">="&Q9;A5:A35;"<="&Q10)

    If i use the dates 01/01/2007-31/01/2007. The sum values are correct.
    If i use dates 01/01/2007-05/02/2007. The sum values ignore the entire range and only focus on numbers between 01-05 of both months.

    Any help would be appreciated.

    Also not sure how to upload a sample copy if i havent explained this too well.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: SumIF within date range over multiple months/years

    A couple of thyings to check first.
    Ensure A5:A35 are actually dates and not text. In a blank column on row 5 enter ISNUMBER(A5) and copy down as far as the 35th row. The answer should say TRUE. If it says FALSE then the value in column A is text and you need to change that value to a proper date.
    Do the same ISNUMBER() for cells Q9 Q10
    If that failes then upload a copy of the file.

    To upload a sample copy

    Post a sample spreadsheet with expected results, remove any sensitive data, create a mockup example if necessary.
    Use the Go Advanced option at the bottom of the page then scroll down to Manage Attachments as the "paperclip" method does not work on this forum.
    Last edited by Special-K; 11-20-2019 at 09:10 AM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    11-20-2019
    Location
    South Africa
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Re: SumIF within date range over multiple months/years

    Hey Special K

    Done that and says uploaded. I have looked. It shows none of the dates as numbers. I have tried to change the cell format to number. Still gives the same error back.As i said ive attempted to upload a copy hope it works.

    Thanks for the help
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: SumIF within date range over multiple months/years

    in U1
    =A1+0
    copy down to U31

    Select U1:U31
    Copy
    Use "Paste Values" overwriting column A

    Column A are now numbers and the result in Q8 has changed from 0.7 to 6.7 which is the total of K1:K8 which are also the rows relating to the date range 17/01/2007 to 31/01/2007 as specified in Q5 and Q6

  5. #5
    Registered User
    Join Date
    11-20-2019
    Location
    South Africa
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Re: SumIF within date range over multiple months/years

    Hi Special K

    When inserting =a1+0, it gives a #value! error in U1.

    Not sure if im being stupid while doing it and missing something obvious?

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: SumIF within date range over multiple months/years

    Use the file you posted in post #3
    Select U1
    type =A1+0
    Result is 17/01/2007 as before but it's now a number as you've added 0 to it.

    Works ok for me.

  7. #7
    Registered User
    Join Date
    11-20-2019
    Location
    South Africa
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Re: SumIF within date range over multiple months/years

    Hi K

    I Have uploaded another copy of the file with the A1+0.

    Sorry if im missing somthing obvious.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: SumIF within date range over multiple months/years

    U1 is based on A1 and is displaying #VALUE.

    A1 contains #VALUE for some reason ???
    It did say 07/01/2007
    Once you fix the error in A1, U1 will correct itself (hopefully).

  9. #9
    Registered User
    Join Date
    11-20-2019
    Location
    South Africa
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Re: SumIF within date range over multiple months/years

    Hey K

    I fixed the dates side. But U1 still displays the same error. for what reason i do not know. I have attached it again with the correct dates.

    Regards
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: SumIF within date range over multiple months/years

    Retype the formula and copy down and follow instructions as before "Paste Values" etc

+ 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. Decimal to Years, Months & date conversion
    By m_skumar in forum Excel General
    Replies: 13
    Last Post: 09-28-2021, 04:51 PM
  2. [SOLVED] Totaling Months and Years from a Date Range
    By hajjar in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-22-2017, 11:51 AM
  3. How to separate Months and Years with multiple months
    By jenpen77 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-10-2017, 01:25 PM
  4. [SOLVED] Age based on DOB; Accounts for leap years. Years old if >2, Months if <2 years old.
    By sharpmel in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-17-2013, 04:20 PM
  5. Date difference in Years and months
    By xenos14 in forum Excel General
    Replies: 4
    Last Post: 11-07-2012, 08:48 AM
  6. No. in age range if age in years and months
    By 13sydwest in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-28-2011, 08:34 AM
  7. Date since hired displayed in years.months
    By JL in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2006, 11:20 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