按月安排的小时数公式

ob欧宝娱乐app手机下载生产跟踪问题。png

我们试图根据项目的开始日期和结束日期确定我们在一个月内为特定项目安排了多少小时。我不太明白如何在没有EOM功能的情况下设置MAX/MIN。有人能帮帮我吗?

答案

  • 吉纳维芙P。
    吉纳维芙P。 员工管理

    @SarahALLBRiGHT

    我的方法是首先找出每个月的工作天数,然后乘以“每天的小时数”。

    我们可以使用MONTH函数来查找开始日期是否在您要查找的月份,如果是,则使用净工作日功能查找“开始日期”至“月底”的工作日数。

    =IF(MONTH([Start Date]@row) = 3, NETWORKDAYS([Start Date]@row, Date (202,03,31)))

    注意我是怎么用日期函数来确定月底。


    然后我们可以用这个数字乘以(用*)每天的小时数:

    =IF(MONTH([Start Date]@row) = 3, NETWORKDAYS([Start Date]@row, Date (2022, 03, 31)) + " days & " + (NETWORKDAYS([Start Date]@row, Date (2022, 03, 31))) * [Hours per Day]@row) + " Hours "


    但是如果起始日期不是在那个月,我们需要检查是否结束日期就在那个月。如果是,我们可以找到从三月开始到结束日期指定的工作日数:

    如果(月(结束@row) = 3, NETWORKDAYS()日期(2022、03、01)结束日期]@row)

    再加上时间:

    IF(MONTH([End Date]@row) = 3, NETWORKDAYS(Date (2022, 03, 01), [End Date]@row) + " days & " + (NETWORKDAYS(Date (2022, 03, 01), [End Date]@row) * [Hours per Day]@row) + " Hours "


    否则,如果两个日期都不在Month中,我们需要查看Start是否在Month中早些时候不如我们的月,而终是晚些时候而不是我们的月份,这意味着整个月份都在我们的范围内:

    IF(AND([Start Date]@row < Date (2022, 03, 01), [End Date]@row > Date (2022, 03, 31)), NETWORKDAYS(Date (2022, 03, 01), Date (2022, 03, 31)) + " days & " + (NETWORKDAYS(Date (2022, 03, 01), Date (2022, 03, 31))) * [Hours per Day]@row) + " Hours "


    完整的公式有三种可能性:

    =如果(月(开始日期@row) = 3,工作日(开始日期@row,日期(2022年03,31))+“&”+(工作日(开始日期@row,日期(2022年03,31))*(小时/天)@row) +“小时”,如果月([结束日期]@row) = 3,工作日(日期(2022、03 01),[结束日期]@row) +“&”+(工作日(日期(2022、03 01),[结束日期]@row) *(小时/天)@row) +“小时”,如果(和((开始日期)@row <日期(2022、03 01),(结束日期)@row >日期(2022年03,31)),工作日(日期(2022、03 01),日期(2022年0331)) +“days &”+ (NETWORKDAYS(DATE(2022, 03, 01), DATE(2022, 03, 31)) * [Hours per Day]@row) +“Hours”))))


    让我知道这是否适合你!

    欢呼,

    吉纳维芙

  • 保罗新来的
    保罗新来的 ✭✭✭✭✭✭

    除了…之外@Genevieve P。的解决方案……


    由于SS没有EOM功能,我们基本上找到下个月的第一天,并从中减去1天。

    =IFERROR(DATE(YEAR([Start DATE]@row), MONTH([Start DATE]@row) + 1,1), DATE(YEAR([Start DATE]@row) + 1,1,1)) - 1

    thinkspi.com

  • 吉纳维芙P。
    吉纳维芙P。 员工管理

    哈哈,@Paul新来的用一个更简洁的公式来挽回局面。谢谢你!

  • 保罗新来的
    保罗新来的 ✭✭✭✭✭✭

    @Genevieve P。哦。这绝对不是整个公式的替代品。这就是如何严格执行Smartsheet中的EOM功能。哈哈。它实际上会使公式变长,因为它会自动计算每月的最后一天。


    =IF(MONTH([Start Date]@row) = 3, NETWORKDAYS([Start Date]@row),IFERROR(DATE(YEAR([Start DATE]@row), MONTH([Start DATE]@row) + 1,1), DATE(YEAR([Start DATE]@row) + 1,1,1)) - 1) +“days &”+ (NETWORKDAYS([起始日期]@row,IFERROR(DATE(YEAR([Start DATE]@row), MONTH([Start DATE]@row) + 1,1), DATE(YEAR([Start DATE]@row) + 1,1,1)) - 1) * [Hours per Day]@row) + " Hours ", IF(MONTH([End Date]@row) = 3, NETWORKDAYS(Date (2022, 03, 01), [End Date]@row) + " days & " + (NETWORKDAYS(Date (2022, 03, 01), [End Date]@row) * [Hours per Day]@row) + " Hours ", IF(AND([Start Date]@row < Date (2022, 03, 01), [End Date]@row))IFERROR(DATE(YEAR([Start DATE]@row), MONTH([Start DATE]@row) + 1,1), DATE(YEAR([Start DATE]@row) + 1,1,1)) - 1)、工作日(日期(202,03,01)、IFERROR(DATE(YEAR([Start DATE]@row), MONTH([Start DATE]@row) + 1,1), DATE(YEAR([Start DATE]@row) + 1,1,1)) - 1) +“days &”+ (NETWORKDAYS(日期(202,03,01),IFERROR(DATE(YEAR([Start DATE]@row), MONTH([Start DATE]@row) + 1,1), DATE(YEAR([Start DATE]@row) + 1,1,1)) - 1) *[每天的小时数]@row) +“小时”)))

    thinkspi.com

  • 哇,你们都是巫师!它工作!

    然而,我只是在寻找返回小时数的公式,这样我们就可以计算出当月所有工作的总小时数。你能提供修改后的配方吗?

    我的歉意。我的例子不太清楚。我写出了天数和小时数,以显示公式如何将一个月的工作日数除以,从而得到该月安排的小时数。

  • 吉纳维芙P。
    吉纳维芙P。 员工管理

    @SarahALLBRiGHT

    你每天有固定的时间吗?例如:每天8小时?如果你有,我们可以用NETWORKDAYS乘以你设定的小时数来计算那个月工作了多少小时。

    在我们的例子中,我们用[小时每天]@row,但你可以直接在公式中用8代替。

    我们还可以去掉“# days”这部分,使其更短。

    =IF(MONTH([Start Date]@row) = 3, (NETWORKDAYS([Start Date]@row), IFERROR(Date (YEAR([Start Date]@row), MONTH([Start Date]@row) + 1,1), Date (YEAR([Start Date]@row) + 1,1,1)) - 1))* 8)+ " hours", IF(MONTH([End Date]@row) = 3, (NETWORKDAYS(Date (202,03,01), [End Date]@row))* 8)+ "小时",IF(AND([Start Date]@row < Date (2022, 03, 01), [End Date]@row > IFERROR(Date (YEAR([Start Date]@row), MONTH([Start Date]@row) + 1,1), Date (YEAR([Start Date]@row) + 1,1,1)) - 1), (NETWORKDAYS(Date (2022, 03, 01)), IFERROR(Date (YEAR([Start Date]@row), MONTH([Start Date]@row) + 1,1), Date (YEAR([Start Date]@row) + 1,1,1)) - 1) *8)+“hours”)))


    这就是你要找的吗?

  • @Genevieve P。不完全是,我们可能每天都有很多人在做这个项目。所以生产的小时数是船员人数乘以一天8小时。下面是我的表布局与实际的列名。如果你能帮我算出每个月生产/预定的小时数,我将不胜感激。

    我试图调整您之前的公式,但正如您所看到的,它返回的预订小时数比总工时要多。不知道该怎么纠正。

    =IF(MONTH([Ops开始日期]@row) = 1, (NETWORKDAYS([Ops开始日期]@row, Date(2022, 1,31)) *[每天产生的小时数]@row), IF(MONTH([Complete Date]@row) = 1, (NETWORKDAYS(Date (2022, 1,1), [Complete Date]@row) *[每天产生的小时数]@row), IF(AND([Ops开始日期]@row < Date (2022, 1,1), [Complete Date]@row > Date (2022, 1,31)), (NETWORKDAYS(Date (2022, 1,1), Date(2022, 1,31))) *[每天产生的小时数]@row))))

    每月工作时间和收入。jpg

    或者我们应该用另一种方法。也许可以用该月生产的小时数除以项目的总人工小时数,得到该月生产的小时数的百分比然后乘以总人工小时数?

  • 保罗新来的
    保罗新来的 ✭✭✭✭✭✭

    您是否有针对二月、三月、四月等月份的附加专栏?


    你是如何使用这些总数的?它们是否具有严格的信息,或者你是否将它们拉入图表的参数表中?


    你可能需要考虑的最长时间是多少?

    thinkspi.com

  • @Paul新来的!是的,我每个月有一个专栏。从那里,我们将把每月的总数拉到生产仪表板上的一个度量表中,这样我们就可以看到我们这个月的预订情况。ob欧宝娱乐app手机下载我想,最长的持续时间是4-5个月。谢谢你的参与。感觉我们很接近了!

  • 保罗新来的
    保罗新来的 ✭✭✭✭✭✭

    嗯…好的。我觉得我们应该快找到答案了。


    我们知道我们需要工作日。函数的开始日期将是每月的第一天或ops的开始日期,这取决于行的开始日期(和结束日期)。我将坚持1月份的公式,因为其他月份只需要进行一些基本的调整。

    =净工作日(如果(MONTH([操作开始日期]@行)= 1,[操作开始日期]@行,如果(AND(MONTH([操作开始日期]@行)< 1,MONTH(完整日期]@行)>= 1),Date (2022, 01, 01))))



    函数的结束日期要么是完整的日期,要么是当月的最后一天。

    =NETWORKDAYS(IF(MONTH([Ops开始日期]@row) = 1, [Ops开始日期]@row), IF(AND(MONTH([Ops开始日期]@row) < 1, MONTH(Complete Date]@row) >= 1), Date (2022, 01, 01))),IF(MONTH([完整日期]@行)= 1,[完整日期]@行,IF(AND(MONTH([操作开始日期]@行)< 1,MONTH(完整日期]@行)>= 1),Date (202,01,31))))


    然后,如果日期没有正确填写(因为1月份没有时间),我们使用IFERROR输出零,并乘以每天产生的小时数。

    =IFERROR (NETWORKDAYS(IF(MONTH([Ops开始日期]@row) = 1, [Ops开始日期]@row, IF(AND(MONTH([Ops开始日期]@row) < 1, MONTH(Complete Date]@row) >= 1), Date (2022, 01, 01))), IF(MONTH([Complete Date]@row) = 1, [Complete Date]@row, IF(AND(MONTH([Ops开始日期]@row) >= 1), Date (2022, 01, 31))))), 0) *[每天生产的小时数]@row



    这个是怎么工作的?为了对每个不同的月份进行调整,您应该能够更新我们比较月份的数字以及每个DATE函数的月份部分。


    我还没有机会测试这个。如果我在你之前得到一个机会,我会回复它是为我工作还是一个不同的公式。

    thinkspi.com

  • 保罗新来的
    保罗新来的 ✭✭✭✭✭✭
    编辑04/14/22

    看起来我遗漏了几个方括号,我添加了一个=(测试公式是针对当前月份的)。


    =IFERROR(NETWORKDAYS(IF(MONTH([Ops开始日期]@row) = 4, [Ops开始日期]@row, IF(AND(MONTH([Ops开始日期]@row) < 4, MONTH([Complete Date]@row) >= 4), Date (2022, 4,1))), IF(MONTH([Complete Date]@row) = 4, [Complete Date]@row, IF(AND(MONTH([Ops开始日期]@row) <= 4, MONTH([Complete Date]@row) >= 4), Date(2022, 4,30)))), 0) *[每天产生的小时数]@row


    还要记住……如果开始日期或结束日期在不同的年份,这将不起作用。如果你需要适应这一点,那么我的建议是进行一些重组。如果是这样的话,请告诉我,如果你有兴趣的话,我很乐意帮助你。

    thinkspi.com

帮助文章参考资料欧宝体育app官方888

You would need to switch over to an AVG\/COLLECT combo to be able to include multiple range\/criteria sets.<\/p>


<\/p>

=AVG(COLLECT([Actual Duration]:[Actual Duration], [Project\/Task\/Issue\/Risk Name]:[Project\/Task\/Issue\/Risk Name], =\"Stage 2\", Project:Project, CONTAINS(\"NTI\", @cell)))<\/p>


<\/p>

NOTE: It will follow the syntax of the COLLECT function where the range you want to average comes first (more like a SUMIFS vs a SUMIF).<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-10-03 20:18:41","updateUser":{"userID":121492,"name":"Kelly Gabel","url":"https:\/\/community.smartsheet.com\/profile\/Kelly%20Gabel","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!kjnW_5tueLw!xPdXcVM75rw!qrOrVgQk8SR","dateLastActive":"2022-10-04T13:49:16+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}}},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"Formulas","name":"Formulas"}]},{"discussionID":96181,"type":"question","name":"How to add an and\/or statement into a sheet formula","excerpt":"I'm a total noob when it comes to formulas and I was hoping someone could assist me with figuring out how to add an \"and\/or\" portion into this formula: =IF(AND([End Date]3 < TODAY(), NOT(Status3 = \"Complete\")), 1, 0) Within the \"Complete\" portion I would like an \"and\/or\" statement for \"Cancelled\". So that the \"At Risk\"…","categoryID":322,"dateInserted":"2022-10-03T20:57:38+00:00","dateUpdated":null,"dateLastComment":"2022-10-04T13:25:35+00:00","insertUserID":153126,"insertUser":{"userID":153126,"name":"MKuhns","url":"https:\/\/community.smartsheet.com\/profile\/MKuhns","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-10-04T13:25:55+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":153126,"lastUser":{"userID":153126,"name":"MKuhns","url":"https:\/\/community.smartsheet.com\/profile\/MKuhns","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-10-04T13:25:55+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":25,"score":null,"hot":3329721793,"url":"https:\/\/community.smartsheet.com\/discussion\/96181\/how-to-add-an-and-or-statement-into-a-sheet-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/96181\/how-to-add-an-and-or-statement-into-a-sheet-formula","format":"Rich","lastPost":{"discussionID":96181,"commentID":345848,"name":"Re: How to add an and\/or statement into a sheet formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/345848#Comment_345848","dateInserted":"2022-10-04T13:25:35+00:00","insertUserID":153126,"insertUser":{"userID":153126,"name":"MKuhns","url":"https:\/\/community.smartsheet.com\/profile\/MKuhns","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-10-04T13:25:55+00:00","banned":0,"punished":0,"private":false,"label":"✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/CKJ2HUAR9VVG\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2022-10-04T13:25:50+00:00","dateAnswered":"2022-10-03T22:29:34+00:00","acceptedAnswers":[{"commentID":345788,"body":"

=IF(AND([End Date]@row < TODAY(), OR([Status]@row = \"Complete\", [Status]@row = \"Cancelled\" )), 0, 1)\n\n<\/pre>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-10-04 13:25:50","updateUser":{"userID":153126,"name":"MKuhns","url":"https:\/\/community.smartsheet.com\/profile\/MKuhns","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-10-04T13:25:55+00:00","banned":0,"punished":0,"private":false,"label":"✭"}}},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":96166,"type":"question","name":"How to link a row with children to another sheet","excerpt":"So I figured out how to link cells between sheets, but my source sheet has a structure 2-3 levels deep (rows with children). If I try to link the entire sheet it shows up at destination sheet but the structure is flattened.","categoryID":322,"dateInserted":"2022-10-03T18:39:32+00:00","dateUpdated":"2022-10-03T18:44:01+00:00","dateLastComment":"2022-10-04T13:26:24+00:00","insertUserID":153109,"insertUser":{"userID":153109,"name":"Eric S.","url":"https:\/\/community.smartsheet.com\/profile\/Eric%20S.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-10-03T20:17:11+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":153109,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2022-10-04T14:06:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":31,"score":null,"hot":3329714156,"url":"https:\/\/community.smartsheet.com\/discussion\/96166\/how-to-link-a-row-with-children-to-another-sheet","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/96166\/how-to-link-a-row-with-children-to-another-sheet","format":"Rich","lastPost":{"discussionID":96166,"commentID":345849,"name":"Re: How to link a row with children to another sheet","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/345849#Comment_345849","dateInserted":"2022-10-04T13:26:24+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2022-10-04T14:06:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2022-10-03T20:20:03+00:00","dateAnswered":"2022-10-03T20:12:57+00:00","acceptedAnswers":[{"commentID":345746,"body":"

You are going to have to manually indent each row where needed. There is no way to automatically indent rows without the help of the API or Bridge add-on.<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-10-03 20:20:03","updateUser":{"userID":153109,"name":"Eric S.","url":"https:\/\/community.smartsheet.com\/profile\/Eric%20S.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-10-03T20:17:11+00:00","banned":0,"punished":0,"private":false,"label":"✭"}}},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]}],"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">