+ Reply to Thread
Results 1 to 5 of 5

Using DSUM with date range

  1. #1
    Registered User
    Join Date
    09-22-2010
    Location
    Dublin
    MS-Off Ver
    Excel 2003
    Posts
    3

    Using DSUM with date range

    I am using a spreadsheet to track & monitor our household expenses. On one sheet have columns for date (as 22/09/2010), category, income & expense. On the second sheet, I have a column for each category of income/expense, & rows for Jan, Feb, Mar, etc.

    In the second sheet I have been using SUM & IF statements to calculate where the category in the first sheet is ‘Phone’, if it is greater than 01 Mar & if it is less than 31 Mar, then add together all corresponding values in the expense column. All these calculations make the spreadsheet wrok very slowly when I change something, & I was wondering if the DSUM formula would work for this? How do I get DSUM to use a range of dates (1 – 31 Mar) as a criteria?

    An example of the formula I am currently using is: {=SUM(IF(Sheet1!B1:Sheet1!B5000=A14,IF(Sheet1!A1:Sheet1!A5000>=DATE(2010,3,1),IF(Sheet1!A1:Sheet1!A5000<=DATE(2010,3,31),Sheet1!E1:Sheet1!E5000,""))))}

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Using DSUM with date range

    Use a pivot table on your source data and group results by month - if you upload an example I can show you how. (Don't use DSUM).
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Registered User
    Join Date
    09-22-2010
    Location
    Dublin
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Using DSUM with date range

    Hi

    Have attached example of spreadsheet. Can you explain also what you are doing please, as I am very unfamiliar with pivot tables.

    Thanks
    Attached Files Attached Files
    Last edited by Altin; 09-23-2010 at 11:21 AM. Reason: To include some example figures in spreadsheet

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Using DSUM with date range

    Thanks for adding examples I downloaded your first spreadsheet and decided to come back to it when I had time to add content to demonstrate with - could have been never.

    Step-by-step (as requested):
    I insert a dynamic named range for the source data - an explanation is here. The formula I used: =offset($A$1,0,0,counta($A:$A),5)
    Then I created a pivot table (alt, d, p)
    Next
    The source is the name I just created (I called it Data)
    New worksheet
    Finish

    Drag Date to the column fields area
    Right click a date, Group and show detail, group
    Group by months
    OK

    Drag category to the row fields

    Now, you could make two pivot tables, looking like the example you uploaded, but what I think might work better is creating a new calculated field incorporating both negative and positive cashflow - so on the pivot table menu bar:
    Pivot table
    Formulas
    Calculated Field
    I called it Cashflow
    Formula='Amount In'-'Amount Out'
    it should appear magically in the 'data' area of the graph - if not drag it there

    Right-click the sum of cashflow button
    Field settings
    Number
    Currency

    OK

    I think that's all you need, you can autoformat the table with Format ->Autoformat

    hth

  5. #5
    Registered User
    Join Date
    09-22-2010
    Location
    Dublin
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Using DSUM with date range

    Hi

    Thanks for the detail. I'll print it & the dynamic named range explanation & step through them.

    All the best

+ 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