帮助w/多个if语句
你好!我是一个新的Smartsheet用户,试图弄清楚多个if语句是否与我正在尝试做的事情一起工作。我想根据房内材料栏和打印机栏中的内容,自动化发布到SGS/打印机栏中的日期。“房屋中的材料”列有我手动输入的预填充日期。打印机列设置为下拉多选。打印机列中的每个选项都有不同的变量,例如,如果打印机是“AFS/Fuji”,则从出厂材料日期减去84天;如果打印机是Amcor,则从出厂材料日期减去77天。我已经弄清楚如何有一个单一的if语句,但当我组合它们时,我得到无效或无法解析。我有两个问题:(1)我如何结合下面的if语句和(2)是否有一个更好的公式,将23个if语句?
=IF(Printer12 = " AFS/Fuji ",[材料库存]12 - 84)
=IF(print12 = "Amcor",[室内材料]12 - 77)
=IF(Printer12 = " Atlantic ", [Materials in House]12 - 56)
=IF(print12 = " Belmark ",[室内材料]12 - 42)
=IF(Printer12 = " CCL Mexico City ",[室内材料]12 - 56)
=IF(print12 = " CCL苏福尔斯",[室内材料]12 - 84)
=IF(print12 = " Elopack ", [Materials in House]12 - 56)
=IF(print12 = " Evergreen ", [Materials in House]12 - 67)
=IF(print12 = " GPI ",[材料在室内]12 - 63)
=IF(print12 = " Green Bay (litho) ", [Materials in House]12 - 49)
=IF(print12 = " Green Bay(预印)",[室内材料]12 - 77)
=IF(Printer12 = " Green Bay(托运人)",[仓库内材料]12 - 49)
=IF(print12 = " HS Crocker ",[室内材料]12 - 63)
=IF(print12 = " Huhtamaki ",[室内材料]12 - 63)
=IF(Printer12 = " Lux ",[室内材料]12 - 49)
=IF(print12 = " PCA (litho) ",[材料在房子]12 - 70)
=IF(print12 = " PCA(预打印)",[室内材料]12 - 70)
=IF(print12 = " PCA(发货人)",[房内材料]12 - 35)
=IF(print12 = "Tetra Edge",[室内材料]12 - 49)
=IF(print12 = " Tetra Prisma ",[材料在房子里]12 - 56)
=IF(print12 = " Tetra Slim ",[室内材料]12 - 49)
=IF(print12 = "Tetra Top(新物品)",[室内材料]12 - 84)
=IF(print12 = " Tetra Top(更新)",[材料在室内]12 - 98)
最佳答案
-
吉纳维芙P。 员工管理
是的,我们可以把所有这些表述结合起来!它不会是一个嵌套的IF语句,因为您希望公式检查每个可能的选项,并根据每个单独的选择减去日期。因此,我实际上用+号把每个语句加在一起。
您需要从一个语句开始,该语句表示如果单元格为空白或TBD,则返回空白。如果不是,那么你可以尝试所有这些选择。
然后你可以先列出带有日期的单元格,然后是所有IF语句,如下所示:
[库存材料]@row - IF(HAS((电子邮件保护),《AFS/Fuji》),84)
HAS声明将查看左边的单元格是否有一个选择和其他选择。
然后让我们添加下一个值:
[库存材料]@row - IF(HAS((电子邮件保护),“AFS/Fuji”),84)+ IF(HAS((电子邮件保护),《Amcor》),77)
然后是下一个:
[库存材料]@row - IF(HAS((电子邮件保护),“AFS/Fuji”),84)+ IF(HAS((电子邮件保护), "Amcor"), 77) + IF(HAS((电子邮件保护),《大西洋》),56)
以此类推,得到完整的公式:
=IF(OR([库存物料]@row = "",[库存物料]@row = "待定"),"",[库存物料]@row - (IF(HAS((电子邮件保护),“AFS/Fuji”),84)+ IF(HAS((电子邮件保护), "Amcor"), 77) + IF(HAS((电子邮件保护),“大西洋”),56)+ IF(HAS((电子邮件保护),“贝尔马克”),42)+ IF(HAS((电子邮件保护),“CCL Mexico City”),56)+ IF(HAS((电子邮件保护),“CCL苏福尔斯”),84)+ IF(HAS((电子邮件保护),“Elopack”),56)+ IF(HAS((电子邮件保护),“常青树”),67)+ IF(HAS((电子邮件保护), " gpi "), 63) + if (has ((电子邮件保护),“绿湾(石)”),49)+ IF(HAS((电子邮件保护),“绿湾(预印本)”),77)+ IF(HAS((电子邮件保护),“绿湾(托运人)”),49)+ IF(HAS((电子邮件保护),“HS Crocker”),63)+ IF(HAS((电子邮件保护),“Huhtamaki”),63)+ IF(HAS((电子邮件保护),“力士”),49)+ IF(HAS((电子邮件保护), "PCA (litho)"), 70) + IF(HAS((电子邮件保护), "PCA(预打印)"),70)+ IF(HAS((电子邮件保护),“PCA(托运人)”),35)+ IF(HAS((电子邮件保护),“利乐边”),49)+ IF(HAS((电子邮件保护),“Tetra Prisma”),56)+ IF(HAS((电子邮件保护),“利乐瘦身”),49)+ IF(HAS((电子邮件保护),“利乐顶(新物品)”),84)+ IF(HAS((电子邮件保护),“利乐顶(更新)”),98)))
我注意到的另一件事是,你的一些引用是倾斜的,像这样:
你要确保它们看起来像这样:
让我知道,如果这对你有用,有意义!
欢呼,
吉纳维芙
答案
-
吉纳维芙P。 员工管理
是的,我们可以把所有这些表述结合起来!它不会是一个嵌套的IF语句,因为您希望公式检查每个可能的选项,并根据每个单独的选择减去日期。因此,我实际上用+号把每个语句加在一起。
您需要从一个语句开始,该语句表示如果单元格为空白或TBD,则返回空白。如果不是,那么你可以尝试所有这些选择。
然后你可以先列出带有日期的单元格,然后是所有IF语句,如下所示:
[库存材料]@row - IF(HAS((电子邮件保护),《AFS/Fuji》),84)
HAS声明将查看左边的单元格是否有一个选择和其他选择。
然后让我们添加下一个值:
[库存材料]@row - IF(HAS((电子邮件保护),“AFS/Fuji”),84)+ IF(HAS((电子邮件保护),《Amcor》),77)
然后是下一个:
[库存材料]@row - IF(HAS((电子邮件保护),“AFS/Fuji”),84)+ IF(HAS((电子邮件保护), "Amcor"), 77) + IF(HAS((电子邮件保护),《大西洋》),56)
以此类推,得到完整的公式:
=IF(OR([库存物料]@row = "",[库存物料]@row = "待定"),"",[库存物料]@row - (IF(HAS((电子邮件保护),“AFS/Fuji”),84)+ IF(HAS((电子邮件保护), "Amcor"), 77) + IF(HAS((电子邮件保护),“大西洋”),56)+ IF(HAS((电子邮件保护),“贝尔马克”),42)+ IF(HAS((电子邮件保护),“CCL Mexico City”),56)+ IF(HAS((电子邮件保护),“CCL苏福尔斯”),84)+ IF(HAS((电子邮件保护),“Elopack”),56)+ IF(HAS((电子邮件保护),“常青树”),67)+ IF(HAS((电子邮件保护), " gpi "), 63) + if (has ((电子邮件保护),“绿湾(石)”),49)+ IF(HAS((电子邮件保护),“绿湾(预印本)”),77)+ IF(HAS((电子邮件保护),“绿湾(托运人)”),49)+ IF(HAS((电子邮件保护),“HS Crocker”),63)+ IF(HAS((电子邮件保护),“Huhtamaki”),63)+ IF(HAS((电子邮件保护),“力士”),49)+ IF(HAS((电子邮件保护), "PCA (litho)"), 70) + IF(HAS((电子邮件保护), "PCA(预打印)"),70)+ IF(HAS((电子邮件保护),“PCA(托运人)”),35)+ IF(HAS((电子邮件保护),“利乐边”),49)+ IF(HAS((电子邮件保护),“Tetra Prisma”),56)+ IF(HAS((电子邮件保护),“利乐瘦身”),49)+ IF(HAS((电子邮件保护),“利乐顶(新物品)”),84)+ IF(HAS((电子邮件保护),“利乐顶(更新)”),98)))
我注意到的另一件事是,你的一些引用是倾斜的,像这样:
你要确保它们看起来像这样:
让我知道,如果这对你有用,有意义!
欢呼,
吉纳维芙
-
lm56 ✭
嗨@Genevieve P。非常感谢!这个工作!
-
吉纳维芙P。 员工管理
太棒了!我很高兴能帮上忙。
帮助文章资源欧宝体育app官方888
类别
For logging changes on a particular sheet, I use an automation that copies the entire row to a different sheet used to log the data changes. The automation is triggered whenever a row is modified or added. One of the columns I have in my main sheet is a system column called Modified and the column type is \"Modified Date\".<\/p>
I then use reports or cross sheet links to create the view of the data that I want from the log file.<\/p>
Hope this is helpful for you and have a great day.<\/p>
Tom<\/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":101730,"type":"question","name":"COUNTIFS with CHILDREN and Status Bar","excerpt":"I am trying to count the number of child rows that have a status bar symbol of Quarter, Half, or Three Quarters. Example: if 2 child rows are half, one is full, one is empty, and one is three quarters, the count should be 3 to account for the two halfs and one three quarters, and negate the empty and full ones. Just trying…","categoryID":322,"dateInserted":"2023-02-24T17:22:04+00:00","dateUpdated":null,"dateLastComment":"2023-02-24T17:34:41+00:00","insertUserID":138915,"insertUser":{"userID":138915,"name":"Kristina S Otten","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Kristina%20S%20Otten","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!xJEmseeh63s!aSEn2qecc_s!4EeZbPMRxDk","dateLastActive":"2023-02-24T17:44:27+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":86866,"lastUser":{"userID":86866,"name":"Jeff Reisman","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Jeff%20Reisman","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/3V8W2AM105QE\/nIDXI4I7VDS7W.JPG","dateLastActive":"2023-02-24T21:37:00+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":15,"score":null,"hot":3354521205,"url":"https:\/\/community.smartsheet.com\/discussion\/101730\/countifs-with-children-and-status-bar","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/101730\/countifs-with-children-and-status-bar","format":"Rich","lastPost":{"discussionID":101730,"commentID":364317,"name":"Re: COUNTIFS with CHILDREN and Status Bar","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/364317#Comment_364317","dateInserted":"2023-02-24T17:34:41+00:00","insertUserID":86866,"insertUser":{"userID":86866,"name":"Jeff Reisman","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Jeff%20Reisman","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/3V8W2AM105QE\/nIDXI4I7VDS7W.JPG","dateLastActive":"2023-02-24T21:37: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":"2023-02-24T17:33:38+00:00","dateAnswered":"2023-02-24T17:27:39+00:00","acceptedAnswers":[{"commentID":364314,"body":"
Here you go, try this:<\/p>
=COUNTIFS(CHILDREN(Progress@row), OR(@cell = \"Quarter\", @cell = \"Half\", @cell = \"Three Quarter\"))<\/p>"},{"commentID":364317,"body":"