返回特定日期的相同Vlookup。

基本上我想做的是一个项目跟踪者。当他们做一个项目时,他们会花一定的时间在上面。这一切都很好,直到项目暂停并重新启动,我有一个问题,它计算出最接近的日期。所以我试着做的是,如果项目开始和结束在同一天,它会使用那个日期。

附件是我的原稿照片。你会看到它的填充物

image.png

看看小时是怎么变成负小时的。(项目开始时间/日期是从另一张表格中提取的)。在上面的照片中,它使用了简单的公式=VLOOKUP([项目编号]。[3,{系统表1范围2},4,假)

因此,为了纠正这个问题,我使用了这个公式

=IF(AND(LEFT([Project Finish Time txt/Date] 3,2) = LEFT({System Sheet 1 Range 4}, 2), VLOOKUP([Project No. 2])3, {System Sheet 1 Range 2}, 1, false) = [Project No.]3), VLOOKUP([Project No.][3,{系统表1范围2},4,假)) what i am trying to do in this formula is if the project started on the same date it ended uses that date to calculate the hours. Not the new date generated when the boys press start project again the next day. And the project no.s match

我得到了#无效数据类型

什么好主意吗?

为我糟糕的语法道歉

标签:

最好的答案

  • 凯莉,

    我是澳大利亚人,所以日期不一样,我们今天读的是2020年4月5日。这就是为什么我试图使用LEFT(REF,2),因为前两个数字是我们在一个月中的一天。

    对于公式

    =MAX(COLLECT({System Sheet 1 Range 4}, {System Sheet 1 Range 5},[项目编号:@row,{系统表1范围4},<[项目完成时间txt/日期]@row)) + ""

    得到0。

    =MAX(COLLECT({System Sheet 1 Range 4}, {4/4/20 System Sheet 1 Range 5},[项目编号:@row,{系统表1范围4},<[项目完成时间txt/日期]@row)) + ""

    我得到#无效ref

    所以澄清一下,我想从某个匹配的项目中获得时间。这是在同一天开始和结束的。

    例如,你正在建造一艘小船。这个项目可能会持续三周,所以每天你都要输入项目编号,然后输入到表格上。您不希望它在一天结束后计算出小时数,因此您再次输入项目编号并按“结束”。这将自动计算该项目当天的工作时间。但是,当您第二天再次开始相同的项目时,它会自动使用创建的时间来计算昨天的开始时间,而不是前一天早些时候的开始时间。很难解释。

答案

  • 卡里。
    卡里。 员工
    编辑04/04/20

    克莱夫。你好!


    如果我想对了,您应该返回系统列中的“最大”日期,该日期小于特定项目行中系统列中的日期。首先可以使用COLLECT将具有相同项目编号和项目开始日期在项目完成日期之前的所有行聚集在一起。然后,您可以使用MAX来查找“最高”或最近的值。在我的试卷上,下面的公式是有效的:

    =MAX(COLLECT(当天查找项目开始时间/日期)},{4/4/20当天查找源项目编号。},[项目编号:@row,{当天查找项目开始时间/日期},<[项目完成时间/日期]@row)) + ""

    {同一天查找项目开始时间/日期}是源工作表上具有开始时间/日期的系统列。

    {当日查找源项目编号。}为项目编号。列。

    + ""用于将结果转换为文本。


    在本例中使用COLLECT的好处是,您可以在希望通过指定人员筛选的事件中添加额外的范围和列。

  • 凯莉,

    我是澳大利亚人,所以日期不一样,我们今天读的是2020年4月5日。这就是为什么我试图使用LEFT(REF,2),因为前两个数字是我们在一个月中的一天。

    对于公式

    =MAX(COLLECT({System Sheet 1 Range 4}, {System Sheet 1 Range 5},[项目编号:@row,{系统表1范围4},<[项目完成时间txt/日期]@row)) + ""

    得到0。

    =MAX(COLLECT({System Sheet 1 Range 4}, {4/4/20 System Sheet 1 Range 5},[项目编号:@row,{系统表1范围4},<[项目完成时间txt/日期]@row)) + ""

    我得到#无效ref

    所以澄清一下,我想从某个匹配的项目中获得时间。这是在同一天开始和结束的。

    例如,你正在建造一艘小船。这个项目可能会持续三周,所以每天你都要输入项目编号,然后输入到表格上。您不希望它在一天结束后计算出小时数,因此您再次输入项目编号并按“结束”。这将自动计算该项目当天的工作时间。但是,当您第二天再次开始相同的项目时,它会自动使用创建的时间来计算昨天的开始时间,而不是前一天早些时候的开始时间。很难解释。

  • 太棒了,起作用了,谢谢

  • 太好了!很乐意帮忙!

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

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

请查看公式手册模板!
@dhawkins<\/a> Try the formula below and let me know if that works. The AND function is a comma separated list of conditions, and always returns only True or False. <\/p>

=IF(AND([Build Approved]@row = 1, [Install Complete]@row = 1, [In Production]@row = 1), \"In Production\", IF(AND([Build Approved]@row = 1, [Install Complete]@row = 1, [In Production]@row = 0), \"Installed\", IF(AND([Build Approved]@row = 1, [Install Complete]@row = 0, [In Production]@row = 0), \"Build Approved\", \"Design\")))<\/p>"},{"commentID":379709,"body":"

=IF([Build Approved]@row = 0, \"Design\", IF([Install Complete]@row = 0, \"Build Approved\", IF([In Production]@row = 0, \"Installed\", \"In Production\")))<\/p>

This may work.<\/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":106232,"type":"question","name":"Check if project start\/end dates fall within specific time frame.","excerpt":"My team works on projects that typically take 6-12 months. I'd like to create a roll-up sheet that identifies which quarters in which a project was worked on. I'm creating a new row for each project and linking in the start and end dates from each of the projects' sheets. Then I've created a new column for each quarter…","categoryID":322,"dateInserted":"2023-06-08T19:44:47+00:00","dateUpdated":"2023-06-08T22:03:24+00:00","dateLastComment":"2023-06-08T20:08:51+00:00","insertUserID":161563,"insertUser":{"userID":161563,"name":"gunnell","title":"Director, eLearning Initiatives","url":"https:\/\/community.smartsheet.com\/profile\/gunnell","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-08T22:02:45+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":161563,"lastUserID":161563,"lastUser":{"userID":161563,"name":"gunnell","title":"Director, eLearning Initiatives","url":"https:\/\/community.smartsheet.com\/profile\/gunnell","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-08T22:02:45+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":1,"countViews":23,"score":null,"hot":3372509018,"url":"https:\/\/community.smartsheet.com\/discussion\/106232\/check-if-project-start-end-dates-fall-within-specific-time-frame","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106232\/check-if-project-start-end-dates-fall-within-specific-time-frame","format":"Rich","lastPost":{"discussionID":106232,"commentID":379713,"name":"Re: Check if project start\/end dates fall within specific time frame.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/379713#Comment_379713","dateInserted":"2023-06-08T20:08:51+00:00","insertUserID":161563,"insertUser":{"userID":161563,"name":"gunnell","title":"Director, eLearning Initiatives","url":"https:\/\/community.smartsheet.com\/profile\/gunnell","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-08T22:02:45+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-08T20:09:01+00:00","dateAnswered":"2023-06-08T20:08:51+00:00","acceptedAnswers":[{"commentID":379713,"body":"


<\/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":106219,"type":"question","name":"Metrics NOT updating periodically as expected","excerpt":"Not sure if anyone is experiencing this. I've created a METRICS sheet for every project that sums up counts for Task Health in order to present on Dashboard through Graphs. I'm noticing that theses metrics are NOT automatically updated unless I refresh the page a dozen times OR re-write the exact same formula again. But…","categoryID":322,"dateInserted":"2023-06-08T17:33:54+00:00","dateUpdated":null,"dateLastComment":"2023-06-08T21:33:47+00:00","insertUserID":161931,"insertUser":{"userID":161931,"name":"Christine Cao","title":"Engagement Manager","url":"https:\/\/community.smartsheet.com\/profile\/Christine%20Cao","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-08T21:32:12+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":161931,"lastUser":{"userID":161931,"name":"Christine Cao","title":"Engagement Manager","url":"https:\/\/community.smartsheet.com\/profile\/Christine%20Cao","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-08T21:32:12+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":4,"countViews":36,"score":null,"hot":3372508061,"url":"https:\/\/community.smartsheet.com\/discussion\/106219\/metrics-not-updating-periodically-as-expected","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106219\/metrics-not-updating-periodically-as-expected","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106219,"commentID":379733,"name":"Re: Metrics NOT updating periodically as expected","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/379733#Comment_379733","dateInserted":"2023-06-08T21:33:47+00:00","insertUserID":161931,"insertUser":{"userID":161931,"name":"Christine Cao","title":"Engagement Manager","url":"https:\/\/community.smartsheet.com\/profile\/Christine%20Cao","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-08T21:32:12+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\/FUCVWKMTVZVX\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-08T21:32:09+00:00","dateAnswered":"2023-06-08T21:03:22+00:00","acceptedAnswers":[{"commentID":379727,"body":"

Hi @Christine Cao<\/a> <\/p>

No problem. Add a date column (and probably hide it). Then go the Automations button on the upper left of the sheet. From there, create new from scratch. I called my automation the same as the column I added; \"TODAY (sheet refresh)\". Below is how my settings are for the automation. I hope that does the trick. -Matt<\/p>

\n
\n \n \"image.png\"<\/img><\/a>\n <\/div>\n<\/div>\n


<\/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"}]}],"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

公式和函数趋势