想要标记重叠的日期和时间

根据我在这里找到的信息,我创建了一个公式,用于识别同一天发生的重叠时间,但我想对其进行调整,以合并发生在多天内的项目。这将用于预订设备。

以下是我目前掌握的信息:

=如果(条件统计(SAP: SAP,(电子邮件保护),[开始日期]:[开始日期],[开始日期]@row,[结束时间]:[结束时间],@cell >=[开始时间]@row,[开始时间]:[开始时间],@cell <=[结束时间]@row) > 1, "No", "Yes")

“SAP”是对该工具的引用。我想在公式中添加“结束日期”。在下面的片段中,第1行和第2行也应该是“no”。

提前感谢!


image.png


标签:

最佳答案

  • Hollie绿色
    Hollie绿色 ✭✭✭✭✭
    ✓回答

    好的,我想我明白了。这是因为你需要把日期和时间结合起来,让它作为一个整体来考虑,而不是单独考虑。因此,您需要一个辅助列来表示开始日期/时间和结束日期时间。我把我的命名为开始日期时间助手和结束日期时间助手。如果您的标题相同,您应该能够复制和粘贴公式。

    开始日期时间助手

    =IFERROR(VALUE(YEAR(DATEONLY([起始日期]@row)) + "" + IF(MONTH(DATEONLY([起始日期]@row)) < 10, "0") + MONTH(DATEONLY([起始日期]@row)) + IF(DAY(DATEONLY([起始日期]@row)) < 10, "0") + DAY(DATEONLY([起始日期]@row)) + IF([起始时间]@row), ""))

    结束日期时间助手

    =IFERROR(VALUE(YEAR(DATEONLY([End Date]@row)) + "" + IF(MONTH(DATEONLY([End Date]@row)) < 10, "0") + MONTH(DATEONLY([End Date]@row)) + IF(DAY(DATEONLY([End Date]@row)) < 10, "0") + DAY(DATEONLY([End Date]@row)) + IF([End Time]@row) + IF([End Time]@row), ""))

    公式来得到你的Yes/No

    =如果(条件统计(SAP: SAP,(电子邮件保护), [End Date Time Helper]:[End Date Time Helper], @cell >= [Start Date Time Helper]@row, [Start Date Time Helper]:[Start Date Time Helper], @cell <= [End Date Time Helper]@row) > 1, "No", "Yes")

答案

  • Hollie绿色
    Hollie绿色 ✭✭✭✭✭

    我认为问题可能是[开始日期]:[开始日期],[开始日期]@row我认为它需要[开始日期]:[开始日期],@cell>=[开始日期]@row或者它将只计算与开始日期完全匹配的开始日期,因此它不会计算6月14日开始的单元格与第一个单元格重叠。

  • 米歇尔·T
    编辑06/19/23

    @Hollie绿色前两行现在被正确标记,但不幸的是,其他应该是OK的行被标记为不OK(第3行应该是OK):

    image.png


  • Hollie绿色
    Hollie绿色 ✭✭✭✭✭
    ✓回答

    好的,我想我明白了。这是因为你需要把日期和时间结合起来,让它作为一个整体来考虑,而不是单独考虑。因此,您需要一个辅助列来表示开始日期/时间和结束日期时间。我把我的命名为开始日期时间助手和结束日期时间助手。如果您的标题相同,您应该能够复制和粘贴公式。

    开始日期时间助手

    =IFERROR(VALUE(YEAR(DATEONLY([起始日期]@row)) + "" + IF(MONTH(DATEONLY([起始日期]@row)) < 10, "0") + MONTH(DATEONLY([起始日期]@row)) + IF(DAY(DATEONLY([起始日期]@row)) < 10, "0") + DAY(DATEONLY([起始日期]@row)) + IF([起始时间]@row), ""))

    结束日期时间助手

    =IFERROR(VALUE(YEAR(DATEONLY([End Date]@row)) + "" + IF(MONTH(DATEONLY([End Date]@row)) < 10, "0") + MONTH(DATEONLY([End Date]@row)) + IF(DAY(DATEONLY([End Date]@row)) < 10, "0") + DAY(DATEONLY([End Date]@row)) + IF([End Time]@row) + IF([End Time]@row), ""))

    公式来得到你的Yes/No

    =如果(条件统计(SAP: SAP,(电子邮件保护), [End Date Time Helper]:[End Date Time Helper], @cell >= [Start Date Time Helper]@row, [Start Date Time Helper]:[Start Date Time Helper], @cell <= [End Date Time Helper]@row) > 1, "No", "Yes")

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

想要直接在智能表中练习使用公式吗?

请查看公式手册模板!
You da man, @Paul Newcome<\/a>! That works perfectly. Thank you!!!<\/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"}]},{"discussionID":106782,"type":"question","name":"IF cell contains specific letter then return value","excerpt":"I'd like to return a value of 120\/208 in Service Volts for Xfmr# ending in E value of 277\/480 for Xfmr# ending in X value of 120\/240 for Xfmr# ending with no letter Thanks","categoryID":322,"dateInserted":"2023-06-22T16:38:09+00:00","dateUpdated":"2023-06-22T16:45:09+00:00","dateLastComment":"2023-06-22T18:12:51+00:00","insertUserID":158055,"insertUser":{"userID":158055,"name":"mromaire","url":"https:\/\/community.smartsheet.com\/profile\/mromaire","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-22T18:12:03+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":91566,"lastUserID":158055,"lastUser":{"userID":158055,"name":"mromaire","url":"https:\/\/community.smartsheet.com\/profile\/mromaire","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-22T18:12:03+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":34,"score":null,"hot":3374911260,"url":"https:\/\/community.smartsheet.com\/discussion\/106782\/if-cell-contains-specific-letter-then-return-value","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106782\/if-cell-contains-specific-letter-then-return-value","format":"Rich","lastPost":{"discussionID":106782,"commentID":381817,"name":"Re: IF cell contains specific letter then return value","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/381817#Comment_381817","dateInserted":"2023-06-22T18:12:51+00:00","insertUserID":158055,"insertUser":{"userID":158055,"name":"mromaire","url":"https:\/\/community.smartsheet.com\/profile\/mromaire","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-22T18:12:03+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\/RLY9EZQ8E5Y9\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-22T18:08:50+00:00","dateAnswered":"2023-06-22T17:35:06+00:00","acceptedAnswers":[{"commentID":381799,"body":"

Hi @mromaire<\/a>,<\/p>

Try this!<\/p>

=IF(RIGHT([xfmr#]@row, 1) = \"X\", \"277\/480\", IF(RIGHT([xfmr#]@row, 1) = \"E\", \"120\/208\", \"120\/240\"))<\/p>

Hope that helps!<\/p>

BRgds,<\/p>

-Ray<\/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":106771,"type":"question","name":"SUMIFS Formula for Column with Various Possible Returns","excerpt":"Hi there! I am a big Excel user switching to Smartsheet and need help with a SUMIFS formula. In Excel, the formula was: =SUM(SUMIFS('Outside Counsel Invoices'!$G:$G,'Outside Counsel Invoices'!$M:$M,\"FY23\",'Outside Counsel Invoices'!$D:$D,{\"=7607\",\"=7607*\"})) Since Wildcards (*) are not used in Smartsheet, I am struggling…","categoryID":322,"dateInserted":"2023-06-22T14:38:12+00:00","dateUpdated":null,"dateLastComment":"2023-06-22T18:57:32+00:00","insertUserID":162633,"insertUser":{"userID":162633,"name":"BuckeyeGirl72","url":"https:\/\/community.smartsheet.com\/profile\/BuckeyeGirl72","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-22T19:01:20+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-22T19:34:53+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":5,"countViews":31,"score":null,"hot":3374907944,"url":"https:\/\/community.smartsheet.com\/discussion\/106771\/sumifs-formula-for-column-with-various-possible-returns","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106771\/sumifs-formula-for-column-with-various-possible-returns","format":"Rich","lastPost":{"discussionID":106771,"commentID":381826,"name":"Re: SUMIFS Formula for Column with Various Possible Returns","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/381826#Comment_381826","dateInserted":"2023-06-22T18:57:32+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-22T19:34:53+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":"2023-06-22T18:38:09+00:00","dateAnswered":"2023-06-22T17:53:03+00:00","acceptedAnswers":[{"commentID":381809,"body":"

It looks like you have a mix of text strings and numerical values. Try the below. If that doesn't work then we do have one more option.<\/p>

SUMIFS({Range To Sum}, {Range To Evaluate}, OR(@cell = 7607, CONTAINS(\"7607\", @cell)))<\/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":[]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=322&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&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 in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

公式和函数趋势