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

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

你好,我有一个安全违规表,它使用表格条目来记录违规行为,并指定一个以天为单位的测量试用期。如果一个人有多个条目,则试用期天数应累计,同时无事故每过一天,该值减少(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公式,但我有麻烦,这看起来像什么。

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


任何帮助都会很感激

谢谢!

答案

  • Krissia B
    Krissia B 主持人

    你好@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

You will need to substitute each space with %20 so when you are adding the Primary Column value use,<\/p>
=SUBSTITUTE([Primary Column]@row, \" \", \"%20\")\n<\/pre>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-09-03 11:16:07","updateUser":{"userID":152031,"name":"austinov","url":"https:\/\/community.smartsheet.com\/profile\/austinov","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-09-03T11:16: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":[]},{"discussionID":95022,"type":"question","name":"Determine if form submissions are missing","excerpt":"Hi there. We have 16 geographically dispersed service locations who perform time of service collections and bank deposits. Our finance team needs to capture and reconcile these collections & deposits on a daily basis. I have created a form to collect time of service collection information from each location, and I'm trying…","categoryID":322,"dateInserted":"2022-09-02T17:59:05+00:00","dateUpdated":null,"dateLastComment":"2022-09-02T20:41:55+00:00","insertUserID":99446,"insertUser":{"userID":99446,"name":"JS_NCHC","url":"https:\/\/community.smartsheet.com\/profile\/JS_NCHC","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-09-02T22:15:46+00:00","banned":0,"punished":0,"private":false,"label":""},"updateUserID":null,"lastUserID":99446,"lastUser":{"userID":99446,"name":"JS_NCHC","url":"https:\/\/community.smartsheet.com\/profile\/JS_NCHC","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-09-02T22:15:46+00:00","banned":0,"punished":0,"private":false,"label":""},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":1,"countViews":21,"score":null,"hot":3324293460,"url":"https:\/\/community.smartsheet.com\/discussion\/95022\/determine-if-form-submissions-are-missing","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/95022\/determine-if-form-submissions-are-missing","format":"Rich","lastPost":{"discussionID":95022,"commentID":342319,"name":"Re: Determine if form submissions are missing","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/342319#Comment_342319","dateInserted":"2022-09-02T20:41:55+00:00","insertUserID":99446,"insertUser":{"userID":99446,"name":"JS_NCHC","url":"https:\/\/community.smartsheet.com\/profile\/JS_NCHC","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-09-02T22:15:46+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-09-02T20:46:38+00:00","dateAnswered":"2022-09-02T20:41:55+00:00","acceptedAnswers":[{"commentID":342319,"body":"

Hi again. I figured out the core formula I needed, so I thought I'd update my post in case others have similar questions in the future.<\/p>

Form for submission is part of \"Daily Collections\" sheet, and SITE NAME is the site submitting the form. I created an Audit sheet with a list of SITE NAME's, and look to the Daily Collections sheet to determine if at least one submission matches with SITE NAME, resulting in \"Y\" or \"N\".<\/p>

=IF(COUNTIF({Daily Collections SITE NAME}, =SITE NAME@row) > 0, \"Y\", \"N\")<\/p>

Thanks! 😁<\/span><\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-09-02 20:46:38","updateUser":{"userID":99446,"name":"JS_NCHC","url":"https:\/\/community.smartsheet.com\/profile\/JS_NCHC","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-09-02T22:15:46+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":95016,"type":"question","name":"Countifs with multiple sheet references and CONTAINS","excerpt":"Hi! I am struggling with how to build the correct formula to provide the result of the following scenario: I am using the Smartsheet \"Fruit Sheet\" to create a formula in the Smartsheet \"Orchard\" Search \"Fruit Sheet\" for any \"Apples\" that may be \"Red\" in the \"Summer\" The sheet has several fruits and several apples. The…","categoryID":322,"dateInserted":"2022-09-02T14:58:09+00:00","dateUpdated":"2022-09-02T15:08:46+00:00","dateLastComment":"2022-09-02T15:55:50+00:00","insertUserID":152024,"insertUser":{"userID":152024,"name":"MoyaC","url":"https:\/\/community.smartsheet.com\/profile\/MoyaC","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-09-02T15:56:00+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":91566,"lastUserID":152024,"lastUser":{"userID":152024,"name":"MoyaC","url":"https:\/\/community.smartsheet.com\/profile\/MoyaC","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-09-02T15:56:00+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":31,"score":null,"hot":3324266039,"url":"https:\/\/community.smartsheet.com\/discussion\/95016\/countifs-with-multiple-sheet-references-and-contains","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/95016\/countifs-with-multiple-sheet-references-and-contains","format":"Rich","lastPost":{"discussionID":95016,"commentID":342299,"name":"Re: Countifs with multiple sheet references and CONTAINS","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/342299#Comment_342299","dateInserted":"2022-09-02T15:55:50+00:00","insertUserID":152024,"insertUser":{"userID":152024,"name":"MoyaC","url":"https:\/\/community.smartsheet.com\/profile\/MoyaC","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-09-02T15:56:00+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-09-02T15:55:57+00:00","dateAnswered":"2022-09-02T15:46:55+00:00","acceptedAnswers":[{"commentID":342297,"body":"

@MoyaC<\/a> <\/p>

The below should work for you:<\/p>

=COUNTIFS({FRUIT_SHEET_FruitType}, \"Apple\", {FRUIT_SHEET_Color}, has(@cell,\"Red\")<\/strong>, {FRUIT_SHEET_Season}, \"Summer\")<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-09-02 15:55:57","updateUser":{"userID":152024,"name":"MoyaC","url":"https:\/\/community.smartsheet.com\/profile\/MoyaC","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-09-02T15:56:00+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":[]}">