How can I debug my complex IF Excel formula?

笑着哭i 提交于 2019-12-01 14:49:00

As was said in the comments, create a table:

Then you would use the following Array formula:

=INDEX(O:O,MATCH(C3,IF($M$1:$M$18=H3,$N$1:$N$18)))

Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly Excel will put {} around the formula.

Each group needs to be together and in ascending order for this method to work.

It does allow the change of criteria and output without changing the hard coded formula.

It should be two separate lookups, because the text lookup is exact and the number lookup is approximate. If for example if you have this in the range A1:D6 :

EM1     0.23    0.43    Exp
EM2     0.7     1.3     2
EM3     1.2     1.8
EXP     1.7     2.3
MAS     2.2     2.8
SUR     2.7     3.3

Then =VLOOKUP("EXP",A1:C6,2,0) results in 1.7 and =VLOOKUP("EXP",A1:C6,3,0) in 2.3

=IF(D2 < VLOOKUP(D1, A1:C6, 2, 0), "Not on track",
 IF(D2 < VLOOKUP(D1, A1:C6, 3, 0), "On track", "Above"))

Here is how to help yourself in 3 steps.

Step 1 - Enlarge the formula bar so it contains more than 1 row:

Step 2 - Use Alt+Enter to make the formula understandable:

Step 3 - On the Excel ribbon, go to Formulas > Evaluate Formula and press evaluate:

Good luck, have fun! :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!