+ Reply to Thread
Results 1 to 8 of 8

sumif formula automatic date change criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    01-11-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    6

    sumif formula automatic date change criteria

    I have a sumif formula with a criteria =01/09/2012, in the cell directly below I need the same formula but now with the criteria =02/09/2012 and so on for every day of the month and the following months through to the end of August. When I fill the formula down the date doesn't change, is there a way I can make the date change automatically so I don't have to change 365 dates?

    The formula looks a bit like this: =SUMIF('sheet1'!G:G,"=01/09/2012",'sheet1'!C:C)*0.03

  2. #2
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: sumif formula automatic date change criteria

    Hi sonor_nut,

    You could try adding +ROW(A1) to the date? This acts as a counter that will increment every cell it goes down (since in the next row it will count ROW(A2) which = 2). This should make the date increment?

    Hope this helps.
    Did I help? Click *- add to my rep.

  3. #3
    Registered User
    Join Date
    01-11-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: sumif formula automatic date change criteria

    Thank you for the reply. My understanding of excel is very limited at the moment. Do you mean something like this: =SUMIF('sheet1'!G:G,"=01/09/2012+ROW(A1)",'sheet1'!C:C)*0.03?

    I have attached an example of the sheet I have, hopefully it will clear things up a bit. I want in sheet 2 column C to have the sumif formula work out what work is going to be delivered on 1 sept then return the value of the corresponding number in column c of sheet 1 * 0.03. I then want to fill the formula down for the other dates. I know the formula is correct because I have manually inputted it into the cells below and changed the date myself to make sure it works. My question is can I not have it automatically change the date so when I fill it from the row containing the date 01/09/2012 to the one below the date in the criteria of the SUMIF formula will change accordingly? Hope that makes sense.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: sumif formula automatic date change criteria

    Quote Originally Posted by sonor_nut View Post
    Thank you for the reply. My understanding of excel is very limited at the moment. Do you mean something like this: =SUMIF('sheet1'!G:G,"=01/09/2012+ROW(A1)",'sheet1'!C:C)*0.03?

    I have attached an example of the sheet I have, hopefully it will clear things up a bit. I want in sheet 2 column C to have the sumif formula work out what work is going to be delivered on 1 sept then return the value of the corresponding number in column c of sheet 1 * 0.03. I then want to fill the formula down for the other dates. I know the formula is correct because I have manually inputted it into the cells below and changed the date myself to make sure it works. My question is can I not have it automatically change the date so when I fill it from the row containing the date 01/09/2012 to the one below the date in the criteria of the SUMIF formula will change accordingly? Hope that makes sense.
    Does this work for you?

    =INDEX(Sheet1!$C$3:$C$1000,MATCH(Sheet2!A3,Sheet1!$G$3:$G$1000,0))*0.03
    Paste into C3 and copy down. This looks at the value in A3 (the date - 1st Sept), finds it within column G of sheet 1 (forecast work in date), and gives the relative value from column C of sheet (the cost on that day) and then multiplies it by 0.03.

    Hope this helps.

  5. #5
    Registered User
    Join Date
    01-11-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: sumif formula automatic date change criteria

    It seems to be starting to work thank you however if it doesn't find anything it returns this: #N/A, is there a way I can get it to return 0 or just leave it blank?

  6. #6
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: sumif formula automatic date change criteria

    Quote Originally Posted by sonor_nut View Post
    It seems to be starting to work thank you however if it doesn't find anything it returns this: #N/A, is there a way I can get it to return 0 or just leave it blank?
    Yep

    =IFERROR(INDEX(Sheet1!$C$3:$C$1000,MATCH(Sheet2!A3,Sheet1!$G$3:$G$1000,0))*0.03,"")
    =IFERROR lets you specify a value for anything where any errors occur. In this case, I put "", which is a blank but you can replace this with zero if you wish.

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,498

    Re: sumif formula automatic date change criteria

    You have had list of dates of months in column A already, why dont you use this:
    =SUMIF(Sheet1!G:G,A3,Sheet1!C:C)*0.17
    Fill down
    or I missed sth?
    Quang PT

  8. #8
    Registered User
    Join Date
    01-11-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: sumif formula automatic date change criteria

    Fantastic, it works. Thank you very much, you've saved me entering about 1000 different formulas for different expenses!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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