+ Reply to Thread
Results 1 to 2 of 2

Help with automatically updating the date with SUMIF statement

  1. #1
    Registered User
    Join Date
    04-27-2012
    Location
    Fresno
    MS-Off Ver
    Excel 2003
    Posts
    1

    Help with automatically updating the date with SUMIF statement

    I have two workbooks that have a separate sheet for each calendar day.

    One workbook contains inventory numbers that are keyed in for each inventory location; no formulas are on this workbook.

    The second workbook contains several SUMIF statements to add up the inventory from the first workbook. For example :

    =SUMIF('[April 2012.xls]27'!$C$6:$C$37,"MILK",'[April 2012.xls]27'!$J$6:$J$37)

    =SUMIF('[April 2012.xls]27'!$C$58:$C$63,"MILK",'[April 2012.xls]27'!$J$58:$J$63)

    =SUMIF('[April 2012.xls]27'!$C$58:$C$63,"CREAM",'[April 2012.xls]27'!$J$58:$J$63)

    =SUMIF('[April 2012.xls]27'!$C$6:$C$63,"OUTSIDE CREAM",'[April 2012.xls]27'!$J$6:$J$63)

    So the second workbook totals up different parts of the first workbook according to if the words MILK or CREAM or OUTSIDE CREAM are found.

    My problem:

    I have to go into the SUMIF statement each day to change the date that the SUMIF statement is referencing. So when I do the inventory for April 27, I have to change the 27. Tomorrow, I will have to go into the formula and change the 27 to a 28; and so on.

    Is there a way to do this automatically without needing to change the day every single time? FYI - each tab in the workbook is a separate day. So April 27 would be on the 27th tab; April 28 would be on the 28th tab; and so on.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Help with automatically updating the date with SUMIF statement

    You could use INDIRECT

    =SUMIF(INDIRECT("'["&TEXT(TODAY(),"mmmm yyyy")&".xls]"&TEXT(TODAY(),"d")&"'!$C$6:$C$37","MILK",INDIRECT("'["&TEXT(TODAY(),"mmmm yyyy")&".xls]"&TEXT(TODAY(),"d")&"'!$J$6:$J$37")

+ 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