任务之间的工作时间
我们希望计算任务结束日期和后续任务开始日期之间的工作时间量。
在包含部分日持续时间的更新之前,我们使用简单的日期算法来执行此操作。现在,这个算法不成立了,我们需要设计一个更新的公式来进行计算。
我有一张试卷(就是这个),其中包含两个简单的项目,Alpha和Beta。每个项目的每个任务都有专人负责。Frank、Bob和Edward碰巧在每个项目中都有任务,这导致了项目Alpha的“自然开始日期”的一些延迟。我们对“自然开始日期”的定义是,在给定无限资源的情况下,根据项目中的前一个任务,任务可以理想地开始的日期。欧宝体育app官方888您可以看到Beta.1导致Alpha.2延迟了一个工作日。我们认为Alpha.2的“自然开始日期增量”是2015年9月29日的开始,但另一个任务是迫使它成为2015年9月30日的开始。在此事件中Alpha.2的“自然开始日期增量”将为1。
alpha2和alpha3之间没有差距,所以自然开始日期Delta在这里是0。
由于Beta.2, Alpha.3和Alpha.4之间有半天的间隔(我们不想让Bob超额预订,对吧?)这里的自然开始日期增量为0.5。
我已经手动输入了“自然开始日期三角洲”的每一行,它是适用的,但我正在寻找一个公式来自动到达那里。我已经建立了(2)文本/数字和(2)日期列类型,可以自由地乱搞(我可以添加更多,如果有人想要它们)。我还为每个任务包含了开始和结束任务的Dateonly(),以防有人想要快速使用这些函数。
最后,我不希望这个公式自动跟随前人的变化。只要考虑已知的前导行,我们可以使用公式硬编码对前导行的任何引用。
评论
-
布雷特•埃文斯 ✭✭✭✭✭✭
约翰,
这绝对是可能的。我认为复杂性取决于你有多少前任。复杂性在于如何迭代连接和解析,以及用于存储公式步骤的隐藏列的数量。
为了解决这个问题,我想我的问题是
1)允许有多少前任。
2)你在文章末尾所说的“自动跟随前任的变化”是什么意思?你能详述一下最后一段吗?我绝对可以为计算这个的单个单元格写一个公式,但我不清楚这个功能。
3)是否有更多的细节,或者你的示例表是否涵盖了所有可能的情况?
欢呼,
布雷特
-
约翰·索伯 ✭✭✭✭✭✭
嗨,布雷特,谢谢你的回复。我同意这当然“感觉”是可行的。回答你的问题:
- 1)为了简单起见,在我的例子中,让我们假设我们只讨论项目中的前身。此外,我们可以假设前驱不改变,并且项目中的每个任务只有一个前驱。如果我们能让这个简化的场景起作用,那么我将把它带到下一个层次。
2)我在这里的意思是,我们可以假设给定任务的前任不会改变,并且给定任务中的前任数量不会改变。我在上面的第1条中已经阐明了这一点。
3)示例表并没有将所有情况都隐藏起来(参见上述假设)。如果我们能够弄清楚这个简单的情况,那么我将使用=MAX函数扩展该功能来分析多个前任(我们目前只使用全天持续时间)。
这足以说明问题吗?
请随意按你想要的方式处理这张表。如果您愿意,我可以添加更多的列,这通常有助于我分阶段设计更复杂的公式,然后在最后将所有公式合并成一个只占用一列的更大的公式(例如,请参阅本例中的“dateonly”列)。
-
约翰·索伯 ✭✭✭✭✭✭
我们一直在与Smartsheet的支持团队就这个主题进行合作,我很高兴地报告说,我们(读:他们)已经得到了一个非常优雅和简单的解决方案!
有一个函数,CALCDURATION(日期/时间,日期/时间)。它的两个必需参数似乎只适用于Date/Time列类型(本发行说明第7项)在启用依赖的表中使用。它的正常后端使用是在层次关系的父行中,它的两个参数是父行中的开始和结束日期/时间列。能够看到这一点的唯一方法是在报表中显示父行的持续时间列,选择父行的持续时间单元格,然后公式将显示为悬停文本。可以使用相同的技术查看如何计算父行的Start和End Date/Time列,以及用于上卷父行中的% Complete列的另一个后端公式。
回到手头的问题上来。在这里的示例中,我们可以使用CALCDURATION()来计算任务的开始日期/时间与其前一个任务的结束日期/时间之间的差值。
原始引用的工作表已被更新并锁定以反映此更改。
感谢社区经理Travis和我们的客户成功经理Austen,他们为这个主题做出了出色的努力,为我们提供了一个出色的解决方案!
-
特拉维斯 员工
很乐意帮忙!我很高兴我们能想出一个解决方案!
对于任何使用CALCDURATION函数的人来说,这是一个警告。这不是一个我们公开提供的函数,因为我们只在后端在项目表上使用它。因为这不是一个公开的公式,我们的开发团队可以随时更改功能或将其全部删除。如果您对此没有意见,那么请随意使用它!
类别
I hope you're well and safe!<\/p>
Unfortunately, it's not possible now, but it's an excellent idea!<\/p>
Please submit this as a Product Feedback or Idea <\/strong>(If it hasn't been added already)<\/em><\/strong> when you have a moment.<\/strong><\/a><\/p> Here's a possible workaround or workarounds <\/strong><\/p> Would that work\/help? <\/p> I hope that helps!<\/p> Be safe, and have a fantastic week!<\/p> Best,<\/p> Andrée Starå<\/strong><\/a> | Workflow Consultant \/ CEO @ WORK BOLD<\/strong><\/a><\/p> ✅Did my post(s) help or answer your question or solve your problem? Please support the Community by <\/em>marking it Insightful\/Vote Up, Awesome, or\/and as the accepted answer<\/em><\/strong>. It will make it easier for others to find a solution or help to answer!<\/em><\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"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":106634,"type":"question","name":"Formula to set the Task Health.","excerpt":"Hi Good Morning, I have a question on this formula. Can you tell me what I did wrong please? Thanks for your great help.","categoryID":321,"dateInserted":"2023-06-20T14:28:24+00:00","dateUpdated":null,"dateLastComment":"2023-06-20T18:04:44+00:00","insertUserID":162441,"insertUser":{"userID":162441,"name":"AAL","title":"Automation - Record a Date","url":"https:\/\/community.smartsheet.com\/profile\/AAL","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-20T18:05:23+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":162441,"lastUser":{"userID":162441,"name":"AAL","title":"Automation - Record a Date","url":"https:\/\/community.smartsheet.com\/profile\/AAL","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-20T18:05:23+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":4,"countViews":35,"score":null,"hot":3374557988,"url":"https:\/\/community.smartsheet.com\/discussion\/106634\/formula-to-set-the-task-health","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106634\/formula-to-set-the-task-health","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106634,"commentID":381364,"name":"Re: Formula to set the Task Health.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/381364#Comment_381364","dateInserted":"2023-06-20T18:04:44+00:00","insertUserID":162441,"insertUser":{"userID":162441,"name":"AAL","title":"Automation - Record a Date","url":"https:\/\/community.smartsheet.com\/profile\/AAL","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-20T18:05:23+00:00","banned":0,"punished":0,"private":false,"label":"✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Using Smartsheet","url":"https:\/\/community.smartsheet.com\/categories\/using-smartsheet"},{"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/Y9UHM44PUCBT\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-20T18:05:21+00:00","dateAnswered":"2023-06-20T17:22:23+00:00","acceptedAnswers":[{"commentID":381355,"body":" Happy to help. 👍️<\/span><\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","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":106637,"type":"question","name":"How can I sum cells that include the abbreviation of states, but include commas in between?","excerpt":"As of right now I am summing selected cells, which then gives me everything that is in those cells. It is then merging them together, but I need it to include a comma if there is more than 1 cell that has information in it.","categoryID":322,"dateInserted":"2023-06-20T14:46:57+00:00","dateUpdated":null,"dateLastComment":"2023-06-20T15:31:02+00:00","insertUserID":151023,"insertUser":{"userID":151023,"name":"haley brianne","title":"","url":"https:\/\/community.smartsheet.com\/profile\/haley%20brianne","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/avatarstock\/nW1W8KHNFR845.png","dateLastActive":"2023-06-20T15:21:53+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"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":"2023-06-20T18:40:04+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":7,"countViews":39,"score":null,"hot":3374551679,"url":"https:\/\/community.smartsheet.com\/discussion\/106637\/how-can-i-sum-cells-that-include-the-abbreviation-of-states-but-include-commas-in-between","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106637\/how-can-i-sum-cells-that-include-the-abbreviation-of-states-but-include-commas-in-between","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106637,"commentID":381333,"name":"Re: How can I sum cells that include the abbreviation of states, but include commas in between?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/381333#Comment_381333","dateInserted":"2023-06-20T15:31:02+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":"2023-06-20T18:40:04+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\/0Z0RK4QSFIJG\/screenshot-2023-06-20-at-9-45-30-am.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"Screenshot 2023-06-20 at 9.45.30 AM.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-20T15:22:33+00:00","dateAnswered":"2023-06-20T15:11:00+00:00","acceptedAnswers":[{"commentID":381325,"body":" Try this instead:<\/p> =JOIN(COLLECT([Dash Columns]12:[Dash Columns]61, [Dash Columns]12:[Dash Columns]61, @cell <> \"//www.santa-greenland.com/community/discussion/2239/\"), \", \")<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"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"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&siteSectionID=0&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":10000,"limit":3},"title":"Trending Posts","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">