+ Reply to Thread
Results 1 to 5 of 5

Counting events on a given day

  1. #1
    Registered User
    Join Date
    03-30-2007
    Posts
    72

    Counting events on a given day

    I have searched the forum for this and was not able to find anything conclusive.
    I have a spreadsheet which in one column has a series of dates/time and in another numbers that represent the outcome of certain events that occurred at that date/time. The number of events in a certain day is random. i would like to be able to sum the numbers that have occurred on specific dates with each date having its own sum. What would be the best way to acomplish that?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Without an example of your data layout I would suggest a PivotTable (see - http://www.excel-it.com/pivot_tables.htm) or COUNTIF.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    03-30-2007
    Posts
    72
    attached is an example
    Attached Files Attached Files

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Counting events on a given day

    As was mentioned.....A Pivot Table handles your request easily.

    Using your posted workbook as an example:
    (Note: I added headings to your data: DateTime and Amount)

    Select Sheet2
    From the Excel Main Menu: <Data><Pivot Table>
    Use: Excel……Click [Next]
    Select your data on Sheet1……Click [Next]
    Click the [Layout] button

    ROW: Drag the DateTime field here
    COLUMN: (Leave this area blank)
    DATA: Drag the Amount field here
    If it doesn't list as Sum of Amount...dbl-click it and set it to Sum
    Click [OK]
    Select where you want the Pivot Table…Click [Finish].

    I know....not quite what you want.....YET...

    Right-Click on the DateTime heading in the Pivot Table
    Select: Group and Show Detail.....Group
    ...Check: Days
    ...Check: Months
    Click [OK]

    Now, the Pivot Table data is grouped by Month and Day
    with Totals by Day.

    Is that something you can work with?

    To refresh the Pivot Table, just right click it and select Refresh Data
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Registered User
    Join Date
    03-30-2007
    Posts
    72
    Quote Originally Posted by Ron Coderre
    As was mentioned.....A Pivot Table handles your request easily.

    Using your posted workbook as an example:
    (Note: I added headings to your data: DateTime and Amount)

    Select Sheet2
    From the Excel Main Menu: <Data><Pivot Table>
    Use: Excel……Click [Next]
    Select your data on Sheet1……Click [Next]
    Click the [Layout] button

    ROW: Drag the DateTime field here
    COLUMN: (Leave this area blank)
    DATA: Drag the Amount field here
    If it doesn't list as Sum of Amount...dbl-click it and set it to Sum
    Click [OK]
    Select where you want the Pivot Table…Click [Finish].

    I know....not quite what you want.....YET...

    Right-Click on the DateTime heading in the Pivot Table
    Select: Group and Show Detail.....Group
    ...Check: Days
    ...Check: Months
    Click [OK]

    Now, the Pivot Table data is grouped by Month and Day
    with Totals by Day.

    Is that something you can work with?

    To refresh the Pivot Table, just right click it and select Refresh Data
    this is a bit different than the way i wanted it done, but it is actually better. Thank you very much for your detailed explanation.

+ 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