(使用 VLOOKUP 解决)Tiered/Nested 一个单元格中的 IF 子句
(SOLVED using VLOOKUP) Tiered/Nested IF clauses within one cell
想象一个这样的分层收入分享方案:
Revenue up to 10000 get 100% of it.
Revenue up to 12000 get the above plus 80% of the amount above 10000.
Revenue up to 14000 get the above plus 60% of the amount above 12000.
Revenue up to 16000 get the above plus 40% of the amount above 14000.
Revenue over 16000 get the above plus 20% of the amount above 16000.
例如13000 的收入将让你分享 10000+0.82000+0.61000 = 12200.
我尝试制作一个 table(每个阈值一列)并使用 IF 子句计算各个分数,然后将它们全部加起来。这很麻烦。我想只使用两个单元格,整个计算在一个单元格中完成,硬编码。
如果可能的话,如果我可以将阈值(10000、12000 等)和分数(100%、80% 等)放在单独的单元格中作为计算参数,可能会有额外的加分像数组函数?
非常感谢您!
开始查找 table,值为 0,查找率为 100%。在这种情况下,最后一个参数等于 1 的 VLOOKUP() 将正确找到所需的行。
为了不为每个值重新计算以上所有行,请提前计算它们并将它们作为附加列放在table中。
对于第一行,它将为 0,并使用类似 =C2+(A3-A2)*B2
的公式计算所有后续值
对于这样的table,一个不太复杂的公式就会return得到正确的结果:
=(<revenue>-VLOOKUP(<revenue>;<lookup_table>;1;1))*VLOOKUP(<revenue>;<lookup_table>;2;1)+VLOOKUP(<revenue>;<lookup_table>;3;1)
VLOOKUP()
函数中的第三个参数从左到右递增:1 - 基础金额,2 - 利率,3 - 达到之前水平的计算加价。
对于图中所示的数据,使用公式
=(E2-VLOOKUP(E2;$A:$C;1;1))*VLOOKUP(E2;$A:$C;2;1)+VLOOKUP(E2;$A:$C7;3;1)
想象一个这样的分层收入分享方案:
Revenue up to 10000 get 100% of it.
Revenue up to 12000 get the above plus 80% of the amount above 10000.
Revenue up to 14000 get the above plus 60% of the amount above 12000.
Revenue up to 16000 get the above plus 40% of the amount above 14000.
Revenue over 16000 get the above plus 20% of the amount above 16000.
例如13000 的收入将让你分享 10000+0.82000+0.61000 = 12200.
我尝试制作一个 table(每个阈值一列)并使用 IF 子句计算各个分数,然后将它们全部加起来。这很麻烦。我想只使用两个单元格,整个计算在一个单元格中完成,硬编码。
如果可能的话,如果我可以将阈值(10000、12000 等)和分数(100%、80% 等)放在单独的单元格中作为计算参数,可能会有额外的加分像数组函数?
非常感谢您!
开始查找 table,值为 0,查找率为 100%。在这种情况下,最后一个参数等于 1 的 VLOOKUP() 将正确找到所需的行。
为了不为每个值重新计算以上所有行,请提前计算它们并将它们作为附加列放在table中。
对于第一行,它将为 0,并使用类似 =C2+(A3-A2)*B2
对于这样的table,一个不太复杂的公式就会return得到正确的结果:
=(<revenue>-VLOOKUP(<revenue>;<lookup_table>;1;1))*VLOOKUP(<revenue>;<lookup_table>;2;1)+VLOOKUP(<revenue>;<lookup_table>;3;1)
VLOOKUP()
函数中的第三个参数从左到右递增:1 - 基础金额,2 - 利率,3 - 达到之前水平的计算加价。
=(E2-VLOOKUP(E2;$A:$C;1;1))*VLOOKUP(E2;$A:$C;2;1)+VLOOKUP(E2;$A:$C7;3;1)