+ Reply to Thread
Results 1 to 26 of 26

make a pivot from tasks per week

  1. #1
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    make a pivot from tasks per week

    I have a sheet (activities per employee) where I have planned "workhours" per "employee" per "activity".

    I would like to make a pivot table that shows per "week" the "name of the employee", its "activity" and the "time that need/will be spend" on that activity.

    I guess I have to make a table in between. (see sheet 1 as example) Is that true? And if that is true, can I automatize that instead of a very error prone copy and paste work? Also, when I have to add an activity later on.

    I have added an example

    your help is very much appreciated.
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: make a pivot from tasks per week

    your second source file doesn't exist so most of the values are: #REF!

  3. #3
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    that is correct, but that info is not really needed for this question (so far as I can assess) I only would like to show that there are formula's in these cells.

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: make a pivot from tasks per week

    Working with #ref!s is very annoying,

    good luck

  5. #5
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    do not want to violate any rule here. I have changed the sheet. no Ref present anymore in the sheet

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: make a pivot from tasks per week

    You have not broken any rules, don't worry.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: make a pivot from tasks per week

    In excel 2016 there is PowerQuery aivailable for re-aranging the data.

    For excel 2010 there is an add-in available.

    Edit:

    A VBA solution is also acceptable?
    Last edited by oeldere; 09-17-2017 at 03:30 AM. Reason: edit added
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: make a pivot from tasks per week

    If it is acceptable.

    See the attached file.

  9. #9
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    Yes pretty much. Wow thanks so far!

    going to check your VBA code. for sure I will have additional questions.

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: make a pivot from tasks per week

    The code works, although it is slow (on your data).

    The result is 10.000 rows with 5 columns

    I added the formula in column F and G manualy (in the table).

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    Dear Oeldere,

    I'm do not understand a lot about VBA. The only thing i can is recording a macro


    First a question about how to run the code.

    if you run the code the table disappears and the columns (year) and (week nr) that is correct?
    Would it be possible to keep the table as before running the macro.

    You created a table with 2 rows of headers, how do you do that. I would like to copy that to my original sheet. the header is important for the formula's in each week.

    IF(AND(((DATE(K$1;1;-2)-WEEKDAY(DATE(K$1;1;3))+(Table12[[#Headers];[40]]+1)*7))>Table12[@[start date]:[start date]];Table12[@[end date]:[end date]]>((DATE(K$1;1;-2)-WEEKDAY(DATE(K$1;1;3))+(Table12[[#Headers];[40]]+1)*7-4)));Table12[@[total needed hours]:[total needed hours]]/((Table12[@[end date]:[end date]]-Table12[@[start date]:[start date]])/7);"")

    I would like to play a bit with your code but until now I did not succeed in copying it to my origin sheet. I guess it has something to do with the columns in between the activity,name and the week numbers which are in my original sheet.

    Is it possible to help me with the lines I have to change to adjust it to my original one? Which is more ore less the same as the one I posted. Actually, the one I posted the first time, was the original. But that was found annoying and i did not want to irritate anybody.

  12. #12
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: make a pivot from tasks per week

    Would it be possible to keep the table as before running the macro.
    Why would you do that if you want to refresh the data.

    I added the formula in column F and G manualy (in the table).
    Is it possible to help me with the lines I have to change to adjust it to my original one?
    First reply if the result shown in the file in my solution #8 is the result you want to achieve.

    If not is it useless to explain the code.

  13. #13
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    Dear Oeldere,

    Try to explain myselve a bit better. If you run the Macro the table layout dissapear and the colunm F and G dissapear. It is not a big problem to overcome this but if possible I would like to keep the layout. Only the data should be changed.

    Yes, is really does what I want. It makes a row for each "activity" , "name" and "week combination" (with content) That is really impressive and nice!!

  14. #14
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: make a pivot from tasks per week

    1) Please also repy if the result in the pivot table is the way you want to achieve.

    2) You addional question is:

    Please put column F and G also in the code?

  15. #15
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    yes the pivot is perfect. I only filtered the zero's and the blanks out of it by adding "value" into the report value.

    1. indeed, i would like to have in column F and G the cod if possible.
    2. You created a table with 2 rows of headers, how do you do that? I would like to copy that to my original sheet. the header is important for the formula's in each week.
    3. I would like to play a bit with your code but until now I did not succeed in copying it to my origin sheet. I guess it has something to do with the columns in between the activity,name and the week numbers which are in my original sheet.
    Is it possible to help me with the lines I have to change to adjust it to my original one? Which is more ore less the same as the one I posted. Actually, the one I posted the first time, was the original. But that was found annoying and i did not want to irritate anybody.

  16. #16
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: make a pivot from tasks per week

    Which is more ore less the same as the one I posted.
    It always has to be exact the same, otherwise you can have differant results.

    But in what part of the code you get a failure?

    After the answers i will amend the code so also column F and G will be added.

  17. #17
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    Dear Oeldere,

    first of all I would like to thank you for your support and patience. Many thanks.

    I added the sheet which is exactly the same at the one I would like to use (origin)

    I do not get a failure in your sheet. The point is that the table disappear after running the code. So not a nice formatted table anymore. Only a the data with the headers above. Absolutely not a problem, the only thing that would be nice is to have the formula (for F and G) inside the code
    I get a failure in my origin sheet.: When I copy the code in my origin, it does not have the same columns as in the example you used for the code. So I (with your help if possible) need to adjust the code so that the right columns are used.
    See attachment, if you can make the code in this attachment I will be helped completely.

    Regards

  18. #18
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: make a pivot from tasks per week

    You have to add row 3, like I did in my post #8.

    After that run the code, and it will work.

  19. #19
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    i have tried to copy everything (my orignial data) into the sheet you created. Once I add extra columns it mess up the data completely.

    I i coppy your code into my original sheet, it only gives the headers but there is not data sorted at all. ( I have added the extra row 3.)

    It is possible for you to adjust it in attachment at #17?

  20. #20
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: make a pivot from tasks per week

    I will this late in the evening or tomorrow (late in the evening).

    If you have no reply then, please bump the question again.

  21. #21
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: make a pivot from tasks per week

    Please Login or Register  to view this content.
    After that the code below.

    Please Login or Register  to view this content.
    See the attached file.

  22. #22
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    Dear Oeldere,

    Once I add an other sheet to this worksheet the code does not work anymore. 2 things that are going wrong so far as I can see.

    -In the added sheet a table is present. 2 values in the header change from text to 0 and 00 (cells F2 and G2) after running the code
    - And/Or once you fill in something in the sheet you adjusted in column C until H the output change and add an extra column in "output" column J
    - the code displays in "output" wrong data and add an extra column with text.`
    - in "output" totals are not displayed. (maybe important?)
    - also macro 1 does not work. (something wrong with table)

    Maybe important to mention is that the added sheet is more or less simular to the one you are using as source ("activities per employee")
    Last edited by jaapaap; 09-20-2017 at 07:51 AM.

  23. #23
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    I have added the file where you can see errors in yellow.
    Attached Files Attached Files
    Last edited by jaapaap; 09-20-2017 at 08:35 AM.

  24. #24
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: make a pivot from tasks per week

    @jaapaap


    You have to try to understand the code, otherwise you can't amend the code for your own purpose.


    Do While .Cells(3, col).Value <> "" 'And .Cells(I, col).Value <> ""
    the red cell refers to row 3, and is meant to read the header (which is in row 3 in the earlier added file).

    in the added sheet there is other info in row 3.

    So the file is not the same as you showed.

    In that case the result is differant.


    col = 11
    In your earlier added file the data begins in column K (is column 11).

    In your new added file the data begins in column I (is column 9).

    So that is also differant.
    Last edited by oeldere; 09-20-2017 at 10:30 AM.

  25. #25
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    Quote Originally Posted by oeldere View Post
    @jaapaap


    You have to try to understand the code, otherwise you can't amend the code for your own purpose.


    So that is also differant.

    correct, and indeed I have no clue what you are doing.

    BTW i have used the one you adjusted yesterday. Maybe I'm wrong but I did not add any column. I aslo did not add an column. I only add some formula's.

    Anyway, gonna try it again
    Last edited by jaapaap; 09-20-2017 at 10:39 AM.

  26. #26
    Forum Contributor
    Join Date
    07-15-2015
    Location
    germany
    MS-Off Ver
    365
    Posts
    100

    Re: make a pivot from tasks per week

    I played a bit with the column and row number.

    it does help a little.

    - the format on sheet "activities per employee" in column G changed to something else.
    Last edited by jaapaap; 09-20-2017 at 10:57 AM.

+ 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] Week over Week change in pivot table
    By trisoldee in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-17-2017, 12:19 PM
  2. How to create one chart for tasks due within a week???
    By mazx222 in forum Excel Charting & Pivots
    Replies: 9
    Last Post: 12-07-2016, 10:48 AM
  3. How to get week-over-week % in pivot table for dissimilar data
    By adityag85 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-15-2016, 05:54 PM
  4. Replies: 0
    Last Post: 09-09-2014, 07:38 AM
  5. Help in using vlookup to make a calander from a list of tasks
    By yammycake in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-22-2014, 11:16 AM
  6. Outlook Tasks - Adding tasks from a worksheet added today or after
    By dpotta in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2010, 07:15 AM
  7. [SOLVED] Make sure ALL tasks in certification exams are in the course!!
    By pattis1313 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-19-2005, 12:10 PM

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