+ Reply to Thread
Results 1 to 5 of 5

capture unique values and calculate

  1. #1
    Registered User
    Join Date
    03-08-2006
    Posts
    28

    capture unique values and calculate

    ok, this is way over my head...maybe even impossible, but here's what i'm trying to accomplish. I want 4 different columns as shown below. In the "Time" and "Ticket" colums i'll track the total amount of time i spend on any given ticket. There may be repeat entries for a ticket. In the totals column I'd *like* it to automatically add an instance for each unique ticket dynamically. So, even though i have ticket #123 entered 3 times, it only shows it once. To make it more difficult, i then want to sum the time for all instances of #123 and place it in the column to the right...does that make any sense? Hope this helps...

    TIME TICKET TOTALS

    0:30 #123 #123 4:45
    1:15 #123 #456 1:00
    3:00 #123
    1:00 #456
    0:15 #456
    Last edited by bcamp1973; 05-08-2006 at 03:15 PM.

  2. #2
    Tim M
    Guest

    RE: capture unique values and calculate

    Have you tried using the 'subtotals' command?
    you can go 'data'....'subtotals' then subtotal at each change in ticket, and
    subtotal the 'time'
    It won't end up looking exactly as you have shown in your example but it
    should do what you want it to do.


    "bcamp1973" wrote:

    >
    > ok, this is way over my head...maybe even impossible, but here's what
    > i'm trying to accomplish. I want 4 different columns as shown below.
    > In the "Time" and "Ticket" colums i'll track the total amount of time i
    > spend on any given ticket. There may be repeat entries for a ticket. In
    > the totals column I'd *like* it to automatically add an instance for
    > each unique ticket dynamically. So, even though i have ticket #123
    > entered 3 times, it only shows it once. To make it more difficult, i
    > then want to sum the time for all instances of #123 and place it in the
    > column to the right...does that make any sense? Hope this helps...
    >
    > TIME TICKET TOTALS
    > ------ -------- --------- -------
    > 0:30 #123 #123 4:45
    > 1:15 #123 #456 1:00
    > 3:00 #123
    > 1:00 #456
    > 0:15 #456
    >
    >
    > --
    > bcamp1973
    > ------------------------------------------------------------------------
    > bcamp1973's Profile: http://www.excelforum.com/member.php...o&userid=32268
    > View this thread: http://www.excelforum.com/showthread...hreadid=539972
    >
    >


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

    Here are a couple ideas:

    1)Use a Pivot Table to summarize total time per ticket.
    Set the function in the DATA area to Sum of Time
    Custom Number Format the Sum of Time column in the Pivot Table as: [h]:mm:ss

    OR

    With your sample data in A1:B7

    C2: #123
    D2: =SUMIF($B$1:$B$10,$C2,$A$1:$A$10)
    Custom Number Format that cell as: [h]:mm:ss

    Do either of those give you something to work with?

    Regards,
    Ron

  4. #4
    Registered User
    Join Date
    03-08-2006
    Posts
    28

    good start...

    Hi Ron, thanks for the feedback. I don't know much about pivot tables so i'm using your second suggestion. That's definitely a good start. Ideally i'd like to show the total just once instead of next to each instance, but this will hold me over...unless you have a suggestion of that of course

    Cheers,
    Brian

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996
    I think a Pivot Table would be the easiest approach, but since you prefer the formulas...See if this works for you:

    In the example I previously posted, the formula in D2 calculates the total time in Col_A where the Col_B value matches C2. For that approach to work for all unique Col_B values, you'd need a list of those values. I'd use an Advanced Filter to build that list:

    C1: TICKET (the same value as B1)
    Select your data in columns A and B, including the column titles in Row_1.

    <data><filter><advanced filter>
    Check: Copy to another location
    Check: Unique records only
    List Range: (your already selected data)
    Criteria Range: (leave this blank)
    Copy To: $C$1
    Click [OK]

    That will create a list of unique Col_B values under C1

    Now, copy the previously posted D2 formula down as far as you need it.

    Does that help?

    Regards,
    Ron

+ 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