+ Reply to Thread
Results 1 to 5 of 5

sorting and calculating unique items

  1. #1
    Forum Contributor
    Join Date
    12-13-2009
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    149

    sorting and calculating unique items

    I am not sure if this question is too complex for a sum if or if it should be a macro or vba?
    I have a list of customers and shop floor actions that i want to sort by a date i choose and by employee. I want to calculate the total time an employee spent on each project on the day that i have chosen. They may spend time on the same project 6 different times in a day. I would like that unique customer consolidated to show each unique only once but add all the times for each unique that day, round to 15 minutes and show hh:mm. I have attached a sample data table as well as the report sheet layout. Yellow is the info I enter, blue is the result I need.
    Any help would be appreciated.
    Attached Files Attached Files
    Southwest Granite & Glass
    Quality, It's what we do
    http://www.swgg.ca

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: sorting and calculating unique items

    Seems like this could be done with a Pivot Table (see attached). If you do a search for something like Excel Pivot table tutorials, you'll fine many useful guides/videos/tutorials on how to make them.
    Attached Files Attached Files
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    12-13-2009
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: sorting and calculating unique items

    Thanks that actually works great but when I add data (sept 15 for example) no matter what i try I cant get it to update.
    I have tried renaming the range and refreshing but to no avail. Thanks
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: sorting and calculating unique items

    I understand what you're saying, but I have an older version of Excel (2003) and can't manipulate your version of the pivot table. I can see it though. Maybe if you were to save the example file as .xls, it might be backward compatible, but I'm not sure.

    I recreated the Pivot Table with the original data and then added your new Sept 15 data. I simply refreshed the Pivot Table and it does show up for me. I Refreshed by right-clicking on the Pivot Table and selected Refresh Data from the pop-up context menu.

    As a wild guess, try this;
    • Right-click on the START DATE pivot.
    • Select Field Settings\Advanced\Autosort = Asscending
    • Then refresh again.

    If it was on Manual sort, it may not have shown the new date column.

    Another guess is maybe there is some sort of incompatibility issue for you when running my older version of the Pivot Table. You may want to build your own table and see if that helps.

    On separate note, if you just wanted to display a specific week; have another formula column on the data sheet to calculate the week-start-date for each row and add that column as a Page Field (see attached.)
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    12-13-2009
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: sorting and calculating unique items

    ok so i figured out how to change the table location so it updates but i can no longer transfer my data. my macro says to transfer anything that the sheet is not named data so im getting a conflict. Thinking a pivot now may not be the answer?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Count Unique Items in a Column Based on Unique Items in Two Other Columns
    By HangMan in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-31-2015, 04:48 PM
  2. [SOLVED] Count the number of Unique Items in a Column for each Unique Item in another Column
    By HangMan in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-27-2015, 01:18 PM
  3. [SOLVED] Get Unique Items
    By plans in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-03-2014, 11:29 PM
  4. [SOLVED] Calculating amount of master items based on mixed amount of items
    By djfscouse in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-21-2014, 11:21 AM
  5. [SOLVED] unique items
    By santanuKD in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-15-2013, 04:46 PM
  6. [SOLVED] Counting # of Unique Items In List & Listing Unique Items In A List
    By unpluggedmusic in forum Excel General
    Replies: 3
    Last Post: 12-05-2012, 11:44 AM
  7. Excel 2007 : Sum of unique items
    By Ger/starter in forum Excel General
    Replies: 12
    Last Post: 10-05-2010, 06:19 AM

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