+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : Sum Data by Date

  1. #1
    Registered User
    Join Date
    08-20-2010
    Location
    Charleston, SC
    MS-Off Ver
    2007
    Posts
    3

    Smile Sum Data by Date

    I have a simple 2 column sheet that I want to total by date. The difficulty that I have it that the date includes time.

    Date/Time | Count
    8/19/2010 06:22 | 3
    8/19/2010 07:33 | 8
    8/19/2010 08:44 | 4
    8/20/2010 06:22 | 7
    8/20/2010 07:33 | 9
    8/20/2010 08:44 | 3

    My sheet has over 3000 records and do not want to manual calculate as I know there is an easier way, but cannot figure it out. What I need to do is to total up the count for each day like...

    8/19/2010 | 15
    8/20/2010 | 19

    I'm sure this is simple to someone.

    Brian

    ADD:
    After submitting my question, I thought that eventually I would want to also sum total by month so I might as well ask now.

    Example:

    January | 89
    February | 112
    March | 72
    etc...
    Last edited by brian1968; 08-21-2010 at 07:56 AM. Reason: Solved

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

    Re: Sum Data by Date

    If the date were listed in E1, then this formula in F1:

    =SUMPRODUCT((INT($A$1:$A$100)=E1)*($B$1:$B$100))

    Expand the matching ranges as needed, do not try and use a whole column, just adjust the range to what is needed.
    _________________
    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!)

  3. #3
    Registered User
    Join Date
    08-20-2010
    Location
    Charleston, SC
    MS-Off Ver
    2007
    Posts
    3

    Re: Sum Data by Date

    Thank you so much Jerry. The formula worked like a charm. You are awesome!!!

  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: Sum Data by Date

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

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

    Re: Sum Data by Date

    Brian, you should really investigate the use of Pivot Tables.

    Attached is an example based on your sample data.

    If you opt against Pivot Tables (most efficient option) then you should - given your use of XL2007 - use SUMIFS rather than SUMPRODUCT esp. if you have lots of unique dates to return data for - the latter is not efficient used en masse or with big data sets.

    Please Login or Register  to view this content.
    If backwards compatibility is an issue then 2 SUMIF functions would be equally viable (or a new field at source which normalises the dates to 1st of month thereby allowing for basic SUMIF)

    FWIW - re: SUMPRODUCT

    Please Login or Register  to view this content.
    given the explicit coercion taking place in the above (*) it's imperative that the sum_range (B1:B100) contain no non-numeric values (eg text strings like header values)

    The alternative / preferred option would be to avoid the explicit coercion of sum_range altogether unless explicitly required, ie:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-20-2010
    Location
    Charleston, SC
    MS-Off Ver
    2007
    Posts
    3

    Re: Sum Data by Date

    This is totally awesome. I've never really investigated Pivot Tables before. The attachment was so helpful to show me the possibilities that I will have to learn this feature of Excel.Thank you so very much.

    Brian

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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