+ Reply to Thread
Results 1 to 6 of 6

SumIF with Dates

  1. #1
    Forum Contributor
    Join Date
    01-26-2008
    Posts
    124

    SumIF with Dates

    In the expense log, Column C is a list of Dates and Column I is a list of expenses. I want to Sum the expenses in the 'Expense Log 09' to a new sheet based on a Date entered in H24 on the new sheet. I have tried the formula as shown below and Get the result #NAME?

    =SUM(IF(Expense Log 'Expenses Log 09'!C8:C100,H24,'Expenses Log 09'!I8:I100))

    I would Like to SUM all expenses After the posted date including that date.

    Thanx

    Jim O
    Last edited by JOGIER; 02-13-2009 at 04:41 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: SumIF with Dates

    Perhaps you mean:

    =SUMIF('Expenses Log'!$C$8:$C$100,">="&H24,'Expenses Log'!$I$8:$I$100)

  3. #3
    Forum Contributor
    Join Date
    01-26-2008
    Posts
    124

    Re: SumIF with Dates

    Yea, that's the ticket! Thanx.

    One further question if I may. using the same data set how would I retrive a SUM from a given period of time, say a week or a few days?

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: SumIF with Dates

    Two ways to try, Don's original SUMIF and then another to subtract the dates after a second cell value, like I24:

    =SUMIF('Expenses Log'!$C$8:$C$100,">="&H24,'Expenses Log'!$I$8:$I$100)-SUMIF('Expenses Log'!$C$8:$C$100,">"&I24,'Expenses Log'!$I$8:$I$100)

    The second would be a SUMPRODUCT formula:

    =SUMPRODUCT(--('Expenses Log'!$C$8:$C$100>=H24),--('Expenses Log'!$C$8:$C$100<I24),Expenses Log'!$I$8:$I$100)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: SumIF with Dates

    There are a few options, the simplest is to conduct 2 SUMIFS... let's assume as before H24 has the "From" date and I24 has the "To" date then to get the Sum of values in between those dates:

    Please Login or Register  to view this content.
    The above sums value >= H24 and subtracts values that exceed I24.

    The other common approach is to use a Sumproduct though this is arguably more "expensive" than the SUMIF approach.

    EDIT: apologies JB, simultaneous posts strike again...

  6. #6
    Forum Contributor
    Join Date
    01-26-2008
    Posts
    124

    Re: SumIF with Dates

    Thank you both for your time and knowledge.

    Jim O

+ 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