根据一系列条件填充柱单元格
我正在努力编写一个函数以填充单元格中的单元格,这取决于其他列的给定值。
因此,基于下面的示例列,我想创建一个函数,该函数根据类型,类型和状态列的值返回特定值。
Eg if type = 'AE', Kind = 'NOM' and Status = '', then cost = 20
if type = 'AE', Kind = 'ANA' and Status = '', then cost = 15
if type = 'AE', Kind = 'ANA' and Status = 'PROS', then cost = 17
同样,对于类型列的其他值。
我希望尽可能多地缩短功能,这意味着不编写((...,...)语句。
基于上述示例,我可以看到我可以看到 if type ='ae
较小的if语句,即
。
' 值为'νομ',请返回20值,或者如果b1中的值为'
=SWITCH(A1,'AE', SWITCH (B1, 'NOM',20'ΑΝ',15))
“ ae”值,如果是的,则如果单元格中的 创建功能以正常工作。
I am struggling with writing a function to fill the cells in a column depending on the given values of other columns.
So based on the sample columns below, I would like to create a function that returns a specific value depending on the values of the Type, Kind, and Status columns.
Eg if type = 'AE', Kind = 'NOM' and Status = '', then cost = 20
if type = 'AE', Kind = 'ANA' and Status = '', then cost = 15
if type = 'AE', Kind = 'ANA' and Status = 'PROS', then cost = 17
Likewise for other values of the type column.
I am looking to shorten the function as much as possible, meaning having not to write a long string of IF(AND(...,...) statements.
Based on the above example I can see that there is a common condition between the smaller if statements, namely the if type = 'AE'.
I have tried using IFS function.
In the end, I opted for the SWITCH function which ensured better readability.
This function would supposedly check if the relevant cell in the type column contains the 'AE' value, and if yes, then if the value in cell B1 is 'ΝΟΜ', return the value of 20 or if the value in B1 is 'AN', return the value 15.
=SWITCH(A1,'AE', SWITCH (B1, 'NOM',20'ΑΝ',15))
However, I can not get my created function to work properly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论