+ Reply to Thread
Results 1 to 14 of 14

SUM of working hours per period and per project crticicality

  1. #1
    Registered User
    Join Date
    09-16-2021
    Location
    Quebec
    MS-Off Ver
    2019
    Posts
    6

    SUM of working hours per period and per project crticicality

    Hello,



    I have the following tables:

    Table 1:

    Project I/D Name Project Criticality Start period 1 (yyyyww) End period 1 (yyyyww) Hours work/week period 1 Start period 2 (yyyyww) End period 2 (yyyyww) Hours work/week period 2
    1 John Smith 1 202101 202143 5 202144 202203 7
    2 Karen Smith 2 202101 202202 4 202203 202304 5
    3 John Smith 2 202110 202113 2 202114 202119 3
    4 Karen Smith 1 202110 202202 1 202203 202245 2



    Table 2:



    Period
    2101
    2102
    2103
    2104
    2105
    2106
    2107
    2108
    2109
    2110
    2111
    2112
    2113
    2114
    2115
    2116
    2117
    2118
    2119
    2120
    2121
    2122
    2123
    2124
    2125
    2126
    2127
    2128
    2129
    2130
    2131
    2132
    2133
    2134
    2135
    2136
    2137
    2138
    2139
    2140
    2141
    2142
    2143
    2144
    2145
    2146
    2147
    2148
    2149
    2150
    2151
    2152
    2201
    2202
    2203
    2204
    2205
    2206
    22..


    On table 2 , I want to add new columns to calculate the SUM of working hours per period and per project criticality. I believe SUMIFS would be the formula to generate these new values., but I have some trouble to do it... Can you please help on the formula to use to generate these new columns?



    Period SUM Hrs / Week C1 John Smith SUM Hrs / Week C2 John Smith SUM Hrs / Week C1 Karen Smith SUM Hrs / Week C2 Karen Smith
    2101
    2102
    2103
    2104



    The file is enclosed as well.



    Kind Regards,
    Attached Files Attached Files
    Last edited by Antoine102; 09-16-2021 at 10:11 AM.

  2. #2
    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,460

    Re: SUM of working hours per period and per project

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are new, I've done it for you today.)
    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.

  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUM of working hours per period and per project crticicality

    if we assume the 2 period ranges are always mutually exclusive you could use something like:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    You could do this same calculation with SUMIFS however, given layout of your source data you would need to combine 2, e.g.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    whichever you adopt, it would be better to store your "headers" such that each 'element' is in a unique cell (e.g. Name & Criticality) and then replace the hardwired values in the formulae with the cell reference containing the relevant parameter

  4. #4
    Registered User
    Join Date
    09-16-2021
    Location
    Quebec
    MS-Off Ver
    2019
    Posts
    6

    Re: SUM of working hours per period and per project crticicality

    XLent,

    What would you mean by storing the headers?

    Thank you !

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUM of working hours per period and per project crticicality

    so, on your result table, insert a new row such that current row 2 becomes row 3 -- in B1 enter name, e.g. John Smith, and B2 enter criticality, e.g. 1 -- then, first result (B3) is:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    you can then apply the above to the results matrix, and by modifying the header values in rows 1 & 2 in each column you will get the respective results.

  6. #6
    Registered User
    Join Date
    09-16-2021
    Location
    Quebec
    MS-Off Ver
    2019
    Posts
    6

    Re: SUM of working hours per period and per project crticicality

    Xlent,I just realized there is a error on my file. The table 1 should be as follow:

    [Project I/D ] [Name ] [ Project Criticality ] [Period 1 End date] [Hours period 1] [Period 2 End date] [Hours period 2 ] [Period 3 End date] [Hours period 3] [Period 4 End date] [Hours period 4]

    Could I still use SUMPRODUCT? What formula would you recommend?

    TKs,

  7. #7
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUM of working hours per period and per project crticicality

    Well, even if we assume Period 1 - 4 dates are continuous, i.e. period 2 starts in the week immediately after 1 concludes (etc), you still have the question of when Period 1 starts ?

    I'd suggest posting an updated sample file that reflects the prior post, with a handful of expected results.
    Last edited by XLent; 09-17-2021 at 04:38 AM.

  8. #8
    Registered User
    Join Date
    09-16-2021
    Location
    Quebec
    MS-Off Ver
    2019
    Posts
    6

    Re: SUM of working hours per period and per project crticicality

    XLent,

    You are right, please find attached the updated sample.

    I have added a ''project start date'' in the file (Column G). The end date would be (column AI)

    I have added some complexity, because utlimately we have 3 ressources working on a project.

    - SQD (Project Database column E) is independent and have their own hours for each gates (column J, M, P, etc...)

    Sourcing Buyer and Commodity Buyer are somewhat related. Ex: John Smith (Sourcing Buyer) and Anthony Smith (Commodity Buyer) cannot work on a project at the same time. John will be working on the project and his hours shall be calculated accrding to (column I, L, O, etc..) until the ''Transfer period'' is reach. This period is when he will hand over the project. Sometime there is only a sourcing buyer or a commodity buyer working on the project and therefore, no transfert period is indicated...

    As for the project ''gates', they are defined starting from column H. Sometimes, there is no work associated to a ''gate'', therefore this is blank.

    Hopefully, this would all make sense,

    BR,
    Attached Files Attached Files

  9. #9
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUM of working hours per period and per project crticicality

    Hi, so, I think that without start date per gate this will be very complicated...

    I've attached an updated version of your previous file with proposal, including results which hopefully reflect the necessary transfer date logic (see 2152/2201), but which does require the addition of the start date per gate.
    {note: I've not verified the results per se, and no expected results provided to validate against}

    Even then, (i.e. with this concession on format of database table), the calculations are still very intensive (and filtering, for ex., would likely generate some lag)

    If this approach proves unviable, either as a result of required format change or performance, I would suggest considering a User Defined Function.

    for sake of disclosure in the thread itself, I've added first calculation for each of the 3 types (per attachment):

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    09-16-2021
    Location
    Quebec
    MS-Off Ver
    2019
    Posts
    6

    Re: SUM of working hours per period and per project crticicality

    Hi Xlent,

    This is exactly what I was looking for, yes, but I does lag a little bit. I wonder if it will be viable when I had more column for the entire employees... At the end I want to show these value as a graph KPI... a workload and capacity KPI.

    Would a user defined function be done in power query? What would be your recommendations on the format?

    Thank you,

  11. #11
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUM of working hours per period and per project crticicality

    Power Query would be an option, yes, though I would then be inclined to use Pivots directly against the PQ dataset, (latter stored in the Data Model).

    Time permitting I will look at this over the weekend, should others not offer PQ solutions in the interim -- note to those that do, the attachment in tab #9 should give a dataset against which you can verify results.

  12. #12
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUM of working hours per period and per project crticicality

    Attached is a potential PQ alternative -- the Pivot is, as per prior post, run off the Data Model - i.e. the PQ script Loads to the Model, and you can connect multiple Pivots to the Model.

    I've attached the rather rudimentary script below -- PQ is not my area of expertise and there are plenty of folk in the board who could no doubt optimise!

    HTH

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

  13. #13
    Registered User
    Join Date
    09-16-2021
    Location
    Quebec
    MS-Off Ver
    2019
    Posts
    6

    Re: SUM of working hours per period and per project crticicality

    Xlent,

    I think this works very well for me !

    As a final request, is there a way I can add a ''max hours per week'' line for each individuals. I have indicated a maximum of hours per week for each ressource under column ''e'' of each sheet ''commoditiy buyer ressource list'', ''sourcing buyer ressource list'' and ''SQD ressource list''.

    Many thanks!
    Attached Files Attached Files

  14. #14
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUM of working hours per period and per project crticicality

    refer attached

    to facilitate, your 3 resource list tabs are converted to Tables, and imported to the model (and subsequently referenced in Model output).
    Attached Files Attached Files

+ 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. Replies: 0
    Last Post: 08-22-2017, 03:49 PM
  2. [SOLVED] Sumifs formula without using sumifs....
    By blockbyblock in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2017, 10:45 AM
  3. [SOLVED] If no SUMIFS matches, 1, otherwise the SUMIFS result...
    By JYTS in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-04-2016, 07:39 PM
  4. sumifs vs. Application.WorksheetFunction.SumIfs
    By flooyd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-01-2016, 11:22 AM
  5. [SOLVED] Looking for something simpler than SUMIFS - SUMIFS
    By YAbdelaal in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-27-2014, 10:38 AM
  6. SUMIFS Puzzle - Trying to avoid adding multiple SUMIFS to get valid result
    By haldavid in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-09-2013, 03:42 PM
  7. [SOLVED] Sumifs, problem with the formula: =sumifs(c10:c200,<=today(),0)
    By Faustocruz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-08-2012, 04:26 AM

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