计算累积值并减少每天的总金额

肖恩·莱希
肖恩·莱希 ✭✭✭✭✭✭

你好,我有一个安全违规表,它使用表格条目来记录违规行为,并指定一个以天为单位的测量试用期。如果一个人有多个条目,则试用期天数应累计,同时无事故每过一天,该值减少(1)。

我有(1)个表作为公司的Name数据库,该表上有一个列使用:=SUMIF({安全违规(响应)范围1},[EMPLOYEE Name]@row,{安全违规(响应)范围2})来显示累积的试用天数。

在我的安全违规表上还有一个列,用于查询每次违规输入的天数:=VLOOKUP([违规严重程度]@row,{安全违规工作表范围2},2,false)

另一列表示试用期每过一天减少(1):=SUM(TODAY() -)(电子邮件保护)) and =SUM([试用期结束(助手)]@row -[试用期天数(助手)]@row)

不幸的是,我使用公式的方式为每个条目减少(1)天,因此,如果John有(3)次违规,则每过一天删除(3)天,并且对于累积的内容应该只减少(1)天。

似乎我可能需要将我的减少(1)天公式移动到我的名称数据库表,旁边的SUMIFS公式,但我有麻烦,这看起来像什么。

我觉得应该有更简单的方法来做这件事……


任何帮助都会很感激

谢谢!

答案

  • 你好@Shawn莱希

    希望一切安好!谢谢你的描述!请您提供截图(请屏蔽任何敏感数据),以便我们可以尝试复制您的设置,以进一步测试这一点。谢谢你~


    欢呼,

    Krissia

  • 肖恩·莱希
    肖恩·莱希 ✭✭✭✭✭✭

    嗨Krissia,

    当然做得很好,希望你也一样!谢谢你的回复,希望你能帮上忙。

    这里有一些截图,我裁剪,隐藏和编辑,但希望你能看到我在做什么。我在它们所在的列中覆盖了我正在使用的公式。如果你还需要看别的东西,请告诉我。

    产DATABASE.jpg
    违反安全规定(回应).jpg
    安全违章工作表。jpg


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

    要为某人拉出最近的约会,你会想要一些类似……

    =DATEONLY(MAX(COLLECT({源数据时间戳列},{源数据名称列},@cell =[违规者名称]@row))))


    从“今天”中减去这个日期,你就会得到那个人从上次事件到现在已经过去了多少天。

    =TODAY() - DATEONLY(MAX(COLLECT({源数据时间戳列},{源数据名称列},@cell =[违规者名称]@row))))

    thinkspi.com

  • 肖恩·莱希
    肖恩·莱希 ✭✭✭✭✭✭

    嗨,保罗,

    谢谢你的时间!

    如果我们只关注当前的违规行为,这些建议将会很好地发挥作用。我们的程序是累积到一个特定的数字导致纪律处分的点,它不会重置与最新的违规行为。

    我希望的是记录违规者累积了多少缓刑日,并减去没有发生事故的天数,所以:

    史蒂夫在6月1日犯了一个错误,被判了182天的缓刑,7月13日又犯了一个错误,被判了182天的缓刑。到8月4日他还剩多少天?

    6月1日至7月13日期间有43天,7月13日至8月4日期间有20天

    182 - 43 + 182 - 20 =截至8月4日,还剩301天试用期。

    我遇到的问题是,我没有办法从多次违规的人身上减去(1)缓刑日。似乎我可能需要优先考虑一个特定的人最近的违规行为,并每天减少(1),但然后以某种方式冻结所有其他人,这样他们就不会倒数直到最近的零。只是不确定那会是什么样子。

    希望这是有意义的。

    感谢你提供的任何帮助。

    谢谢!

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

    我的歉意。我以为你已经把其他的都弄清楚了只是不知道上次违规有多少天了。当我有更多的时间来解决这个问题时,我会再来找你的。

    thinkspi.com

  • 肖恩·莱希
    肖恩·莱希 ✭✭✭✭✭✭

    别担心,谢谢你的时间!

  • 詹姆斯•马
    詹姆斯•马 ✭✭✭✭

    我认为,在每一次事件中,你都需要数一数距离上次事件发生的日子。为了做到这一点,您需要在所有小于此事件的事件日期中找出最大事件日期。

    这里有一条线在这里用两张公开的表格来做这个。我觉得在这条路的某个地方可以找到解决办法。

  • 肖恩·莱希
    肖恩·莱希 ✭✭✭✭✭✭

    你好,詹姆斯,

    感谢你对这件事的投入,这里的事情变得安静了,看起来这可能太多了。

    我看了你分享的例子,我没有看到我的问题的立竿见影的解决方案,但你至少给了我一些不同的方法来看待它。

    我再做些测试,看看能不能让它起作用。

    谢谢!

  • 保罗H
    保罗H ✭✭✭✭✭
    编辑04/23/22

    @Shawn莱希@James马@Paul新来的

    看起来是个不错的挑战,你觉得怎么样?

    image.png

    以前的违反

    =MAX(COLLECT([违规日期]:[违规日期],[违规日期]:[违规日期],MAX(COLLECT([违规日期]:[违规日期],Name:Name,(电子邮件保护),[违规日期]:[违规日期],<[违规日期]@row),名称:名称,(电子邮件保护))))

    上次违规后的十天

    =IFERROR(NETDAYS([先前违规]@row,[违规日期]@row) - 1,0)

    之前添加

    =MAX(COLLECT([缓刑添加]:[缓刑添加],[违规日期]:[违规日期],MAX(COLLECT([违规日期]:[违规日期],Name:Name,(电子邮件保护),[违规日期]:[违规日期],<[违规日期]@row),名称:名称,(电子邮件保护))))

    运行总

    =IF(ISBLANK([上次违规]@row),[缓刑添加]@row, IF([上次添加]@row -[上次违规后的十天]@row < -[上次添加]@row, -[上次添加]@row,[上次添加]@row))

    累积总

    =条件求和(名称:名称、(电子邮件保护),[总跑数]:[总跑数])


    编辑

    添加了第二个名字来检查,似乎起作用了

    image.png


  • 肖恩·莱希
    肖恩·莱希 ✭✭✭✭✭✭

    嗨,保罗·H,

    很抱歉回复晚了,我没有太多的时间来做这件事,我手上的创可贴还在……

    欢迎来到字符串,感谢您的贡献!

    这似乎是工作,它是比我有很多好,但我仍然有一点麻烦与累计总数。如果“缓刑添加”值保持一致,则模型看起来不错。我注意到,当我输入一个新条目时,在“缓刑添加”字段中输入一个值之前,“累计总数”填充,添加一个不同的值没有区别

    看起来像“运行总数”将“先前添加”减去“自上次违规以来的Netdays”,但如果“先前违规”是空白的,它将在行中填充“缓刑添加”值。这有点奏效,但它不考虑当前的违规行为,这可能会更高,并导致暂停(任何高于547缓刑天的值都会导致暂停,所以我需要查看当前的缓刑添加)。

    而且,时间上的相关性似乎只与之前的违规行为有关,因此,如果一名员工在几个月内有几次违规行为,它就会计算得很好,但如果该员工在几年后再次发生违规行为,它就不能准确地减少过去的天数。看起来,当输入新的违规时,如果“Netdays Since violation”小于“previous Added”中的值,则公式将计算先前“previous Added”的值,但它将减去,但不超过该值(“PA”=182,“NSPV”=172,“RT”=10)(“PA”=182,“NSPV”=760,“RT”=-182),并且“Running Total”保存过去几年未滚动的所有先前数据。

    目的很简单:从(0)开始“试用日”,并在发布时添加违规行为,每过一天无事件发生,累计总数减少(1)。如果你达到(547)个试用日,你将被终止。不幸的是,事实证明建立一个正确计算的公式有点困难。

    我想詹姆斯是对的,答案就在这里的某个地方。


    感谢您的帮助!

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

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

请查看公式手册模板!
@Christopher Flemings<\/a> <\/p>

=IF([CONDITIONAL LICENCE]@row, DATE(if(MONTH([Determination Date]@row)=12,YEAR([Determination Date]@row)+1,YEAR([Determination Date]@row)), MONTH([Determination Date]@row) + 1, DAY([Determination Date]@row)), \"//www.santa-greenland.com/community/discussion/comment/\")<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-12-05 19:15:44","updateUser":{"userID":126337,"name":"Christopher Flemings","url":"https:\/\/community.smartsheet.com\/profile\/Christopher%20Flemings","photoUrl":"https:\/\/lh3.googleusercontent.com\/-6uhStWCmgRc\/AAAAAAAAAAI\/AAAAAAAAAAA\/ACHi3rcm-Jq0CJqPMi7PAdar4X8wZHjMlw\/mo\/photo.jpg","dateLastActive":"2022-12-05T19:43:02+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":98391,"type":"question","name":"Help w\/multiple AND NOT ISBLANK date field formula","excerpt":"Hi team - I have 6 date column fields that are automatically formatted (record a date) when a Status field changes. Let's just call those columns: Date1 Date2 Date3 Date4 Date5 Date6 I created a check box \"helper column\" that I'd like to create a formula that looks across those fields to determine if ALL of them have a…","categoryID":322,"dateInserted":"2022-12-04T15:40:46+00:00","dateUpdated":null,"dateLastComment":"2022-12-05T14:52:40+00:00","insertUserID":118864,"insertUser":{"userID":118864,"name":"jmo","title":"","url":"https:\/\/community.smartsheet.com\/profile\/jmo","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!g0lA5zVbOLw!-wfAd_lcHz4!voKaS5U1cZv","dateLastActive":"2022-12-05T14:51:27+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"updateUserID":null,"lastUserID":118864,"lastUser":{"userID":118864,"name":"jmo","title":"","url":"https:\/\/community.smartsheet.com\/profile\/jmo","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!g0lA5zVbOLw!-wfAd_lcHz4!voKaS5U1cZv","dateLastActive":"2022-12-05T14:51:27+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":4,"countViews":30,"score":null,"hot":3340422806,"url":"https:\/\/community.smartsheet.com\/discussion\/98391\/help-w-multiple-and-not-isblank-date-field-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/98391\/help-w-multiple-and-not-isblank-date-field-formula","format":"Rich","lastPost":{"discussionID":98391,"commentID":353142,"name":"Re: Help w\/multiple AND NOT ISBLANK date field formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/353142#Comment_353142","dateInserted":"2022-12-05T14:52:40+00:00","insertUserID":118864,"insertUser":{"userID":118864,"name":"jmo","title":"","url":"https:\/\/community.smartsheet.com\/profile\/jmo","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!g0lA5zVbOLw!-wfAd_lcHz4!voKaS5U1cZv","dateLastActive":"2022-12-05T14:51:27+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-12-05T14:51:25+00:00","dateAnswered":"2022-12-04T15:45:20+00:00","acceptedAnswers":[{"commentID":353088,"body":"

Hey @jmo<\/a> <\/p>

Are your date fields contiguous (all side by side?). I'm assuming they are. If not, each date field will have to be added to the COUNTIFS individually<\/p>

=IF(COUNTIFS([Date1]@row:[Date6]@row, ISDATE(@cell))=6, 1)<\/p>

Will this work for you?<\/p>

Kelly<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-12-05 14:51:25","updateUser":{"userID":118864,"name":"jmo","title":"","url":"https:\/\/community.smartsheet.com\/profile\/jmo","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!g0lA5zVbOLw!-wfAd_lcHz4!voKaS5U1cZv","dateLastActive":"2022-12-05T14:51:27+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":98384,"type":"question","name":"using OR and multiple expressions","excerpt":"I created this statement using OR and CONTAINS to select a value between 2 expressions - Stage 1 or Stage 2: =IF(OR(CONTAINS(\"Stage 1\", Function@row), CONTAINS(\"Stage 2\", Function@row)), IF([Example Result]@row >= -30, 1)) This works fine for recognizing and providing results for Stage 1 & 2 logical expressions. I want to…","categoryID":322,"dateInserted":"2022-12-02T21:55:26+00:00","dateUpdated":null,"dateLastComment":"2022-12-05T19:26:17+00:00","insertUserID":137060,"insertUser":{"userID":137060,"name":"Rick Girard","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Rick%20Girard","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!HMfRH3j3jTw!bqDQWyzsXGY!XokT-B0EOdM","dateLastActive":"2022-12-05T19:24:55+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"},"updateUserID":null,"lastUserID":137060,"lastUser":{"userID":137060,"name":"Rick Girard","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Rick%20Girard","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!HMfRH3j3jTw!bqDQWyzsXGY!XokT-B0EOdM","dateLastActive":"2022-12-05T19:24:55+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":19,"score":null,"hot":3340287703,"url":"https:\/\/community.smartsheet.com\/discussion\/98384\/using-or-and-multiple-expressions","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/98384\/using-or-and-multiple-expressions","format":"Rich","lastPost":{"discussionID":98384,"commentID":353203,"name":"Re: using OR and multiple expressions","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/353203#Comment_353203","dateInserted":"2022-12-05T19:26:17+00:00","insertUserID":137060,"insertUser":{"userID":137060,"name":"Rick Girard","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Rick%20Girard","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!HMfRH3j3jTw!bqDQWyzsXGY!XokT-B0EOdM","dateLastActive":"2022-12-05T19:24: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,"attributes":{"question":{"status":"accepted","dateAccepted":"2022-12-05T19:26:31+00:00","dateAnswered":"2022-12-03T01:15:13+00:00","acceptedAnswers":[{"commentID":353070,"body":"

Hey @Rick Girard<\/a> <\/p>

It looks like a parenthesis is missing to close off the OR statement.<\/p>

=IF(OR(CONTAINS(\"Stage 1\", Function@row), CONTAINS(\"Stage 2\", Function@row), CONTAINS(\"Stage 3\", Function@row))<\/strong>, IF([Example Result]@row >= -30, 1))<\/p>

Will this work for you<\/p>

Kelly<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-12-05 19:26:31","updateUser":{"userID":137060,"name":"Rick Girard","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Rick%20Girard","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!HMfRH3j3jTw!bqDQWyzsXGY!XokT-B0EOdM","dateLastActive":"2022-12-05T19:24: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":[]}],"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">