+ Reply to Thread
Results 1 to 17 of 17

Change Date Range when dragging SUMIFS equation

  1. #1
    Registered User
    Join Date
    08-16-2016
    Location
    Worcester, Ma
    MS-Off Ver
    Office 2013
    Posts
    8

    Change Date Range when dragging SUMIFS equation

    I need to update my spreadsheet yearly for new work orders and changing each cell is quite tedious. The following is my equation:

    =SUMIFS('NWMCC Quantities'!$AK$6:$AK$6734,'NWMCC Quantities'!$O$6:$O$6734,"Light",'NWMCC Quantities'!$A$6:$A$6734,">=01/01/2016",'NWMCC Quantities'!$A$6:$A$6734,"<02/01/2016")

    when dragging the equation I would like it to become:

    =SUMIFS('NWMCC Quantities'!$AK$6:$AK$6734,'NWMCC Quantities'!$O$6:$O$6734,"Light",'NWMCC Quantities'!$A$6:$A$6734,">=02/01/2016",'NWMCC Quantities'!$A$6:$A$6734,"<03/01/2016")

    and so on.

    I have tried updating the second cell to give it the pattern, but it will just repeat the same two ranges over and over. I have also tried putting the dates into separate cells on another sheet and using the Cell ID in the equation instead of the date, but then the equation will just compute a zero.

    Thank you.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Change Date Range when dragging SUMIFS equation

    I don't see why putting the dates in cells and referring to those cells won't work.

    When you refer to the cells you have to do it like this...

    A1 = 01/01/2016
    B1 = 02/01/2016

    =SUMIFS('NWMCC Quantities'!$AK$6:$AK$6734,'NWMCC Quantities'!$O$6:$O$6734,"Light",'NWMCC Quantities'!$A$6:$A$6734,">="&A1,'NWMCC Quantities'!$A$6:$A$6734,"<"&B1)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Change Date Range when dragging SUMIFS equation

    You would put the other dates in A2:B2, A3:B3, A4:B4, etc.

  4. #4
    Registered User
    Join Date
    08-16-2016
    Location
    Worcester, Ma
    MS-Off Ver
    Office 2013
    Posts
    8

    Re: Change Date Range when dragging SUMIFS equation

    =SUMIFS('NWMCC Quantities'!$AK$6:$AK$6734,'NWMCC Quantities'!$O$6:$O$6734,"Light",'NWMCC Quantities'!$A$6:$A$6734,">="&Code!A1,'NWMCC Quantities'!$A$6:$A$6734,"<"&Code!B1)

    Is my new code. Using sheet "code" to hide the date cells as this is a dashboard for presentations. If my dates on the code sheet are reading as 1/1/2016 and 2/1/2016 would it make the difference?

  5. #5
    Registered User
    Join Date
    08-16-2016
    Location
    Worcester, Ma
    MS-Off Ver
    Office 2013
    Posts
    8

    Re: Change Date Range when dragging SUMIFS equation

    Just made the update in the formatting to match the original equation and it still zero outs the equation

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Change Date Range when dragging SUMIFS equation

    Quote Originally Posted by tmpl912 View Post
    If my dates on the code sheet are reading as 1/1/2016 and 2/1/2016 would it make the difference?
    Shouldn't.

    I'm assuming those dates are in the m/d/y format.

  7. #7
    Registered User
    Join Date
    08-16-2016
    Location
    Worcester, Ma
    MS-Off Ver
    Office 2013
    Posts
    8

    Re: Change Date Range when dragging SUMIFS equation

    Just updated them to mm/dd/yyyy format to match the numbers in the original equation.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Change Date Range when dragging SUMIFS equation

    Quote Originally Posted by tmpl912 View Post
    Just made the update in the formatting to match the original equation and it still zero outs the equation
    Could be that your dates in 'NWMCC Quantities'!$A$6:$A$6734 aren't real Excel dates.

    What result do you get from this formula:

    =COUNT('NWMCC Quantities'!$A$6:$A$6734)

    If every cell in that range contains a true Excel date then the formula should return 6729.

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Change Date Range when dragging SUMIFS equation

    Working on the assumption that the original formula works with hard coded dates like this ">=01/01/2016"
    Then the problem is more likely that the dates were not correctly entered as dates on the Code sheet, A1 and B1

    What do these return
    =ISNUMBER(Code!A1)
    =ISNUMBER(Code!B1)

  10. #10
    Registered User
    Join Date
    08-16-2016
    Location
    Worcester, Ma
    MS-Off Ver
    Office 2013
    Posts
    8

    Re: Change Date Range when dragging SUMIFS equation

    Quote Originally Posted by Tony Valko View Post
    Could be that your dates in 'NWMCC Quantities'!$A$6:$A$6734 aren't real Excel dates.

    What result do you get from this formula:

    =COUNT('NWMCC Quantities'!$A$6:$A$6734)

    If every cell in that range contains a true Excel date then the formula should return 6729.
    When using the COUNT formula it returns 227, but not every cell in that range is filled. Currently the cells are only filled from A6 to A232.
    Last edited by tmpl912; 08-17-2016 at 10:15 AM.

  11. #11
    Registered User
    Join Date
    08-16-2016
    Location
    Worcester, Ma
    MS-Off Ver
    Office 2013
    Posts
    8

    Re: Change Date Range when dragging SUMIFS equation

    Quote Originally Posted by Jonmo1 View Post
    Working on the assumption that the original formula works with hard coded dates like this ">=01/01/2016"
    Then the problem is more likely that the dates were not correctly entered as dates on the Code sheet, A1 and B1

    What do these return
    =ISNUMBER(Code!A1)
    =ISNUMBER(Code!B1)
    The coding does work with hard coded dates in the formula. Both of these equations return a True Statement

  12. #12
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Change Date Range when dragging SUMIFS equation

    Maybe as Tony eluded to in Post #6
    The dates you put in A1 and B1 are not the same as the ones you hard coded in the formula..

    Maybe you entered 02/01/2016 expecting that to be February 1st, but Excel read it as January 2nd (or vice versa)

    Format those 2 cells as
    mmm dd yyyy

    Do they show the date you expected?

  13. #13
    Registered User
    Join Date
    08-16-2016
    Location
    Worcester, Ma
    MS-Off Ver
    Office 2013
    Posts
    8

    Re: Change Date Range when dragging SUMIFS equation

    With that formatting they show as Jan/01/2016 and still zeroed out the equation. With the mm dd yyyy they show the same as in the hard code

  14. #14
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Change Date Range when dragging SUMIFS equation

    With that formatting they show as Jan/01/2016
    And the other? There were 2 dates in question.

    Can you give specific answer,
    A1 formatted as mmm dd yyyy shows as ??
    B1 formatted as mmm dd yyyy shows as ??

  15. #15
    Registered User
    Join Date
    08-16-2016
    Location
    Worcester, Ma
    MS-Off Ver
    Office 2013
    Posts
    8

    Re: Change Date Range when dragging SUMIFS equation

    Just got it to work. Made an embarrassing rookie mistake while going through this. Had the wrong code date going into the range, so the SUMIF equation was returning everything as false. Thank you both of you for your help. In getting this setup. It will make my life much easier for new contracts. Thank you again.

  16. #16
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Change Date Range when dragging SUMIFS equation

    You're welcome.

  17. #17
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Change Date Range when dragging SUMIFS equation

    Good deal. Thanks for the feedback!

+ 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] how to reference horizontal rows to vertical columns by dragging with an equation
    By karim.zheng in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-01-2015, 12:05 PM
  2. Dragging SUMIFS function
    By docdee24 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-17-2015, 01:33 AM
  3. Dragging SUMIFS but need ranges to offset
    By LK0001 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-06-2014, 09:57 AM
  4. [SOLVED] Dragging SUMIFS formula
    By msworkman in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-22-2013, 12:11 AM
  5. [SOLVED] dragging an equation but only changing one part of the equation
    By mufan in forum Excel General
    Replies: 7
    Last Post: 04-12-2012, 02:48 PM
  6. Replies: 3
    Last Post: 04-09-2012, 01:36 PM
  7. Using SumIfs to change range based on dropdown
    By rgold in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-15-2010, 11:03 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