简体   繁体   English

为什么 INDEX/MATCH 打印 0 而不是我在 EXCEL 中所期望的

[英]Why does INDEX/MATCH print 0 instead of what I expect in EXCEL

I just started using INDEX/MATCH function in Excel and have no idea why it is printing only 0我刚开始在 Excel 中使用 INDEX/MATCH function 并且不知道为什么它只打印 0

=INDEX(DATA!$B:$B, MATCH(index!$C3, DATA!$A:$A,0))

So Im using the expression above and have no trouble with the result.所以我使用上面的表达式并且结果没有问题。

However when I try to print the column with Korean (DATA:$C:$C) it shows only 0但是,当我尝试用韩语 (DATA:$C:$C) 打印列时,它只显示 0

other than C column it has no problem printing out:( ($D:$D, $E:$E,... and so on has no problem)除了 C 列打印出来没有问题:(($D:$D, $E:$E,...等没有问题)

When the value returned by INDEX is blank, Excel often interprets it as a number (0).INDEX返回的值为空白时,Excel往往将其解释为数字(0)。

There are a number of ways to rectify it.有很多方法可以纠正它。 If you want the result to always be a string, you can simply add an empty string onto the end of the result:如果您希望结果始终是字符串,您可以简单地在结果末尾添加一个空字符串:

 =INDEX(DATA!$B:$B, MATCH(index!$C3, DATA!$A:$A,0)) & ""

If you are not sure if it will return a number or a string, you can wrap your formula in an IF to force blanks to return as an empty string instead of a number:如果您不确定它是否会返回数字或字符串,您可以将公式包装在IF中以强制空白返回为空字符串而不是数字:

=IF(
    INDEX(DATA!$B:$B, MATCH(index!$C3, DATA!$A:$A,0))="",
    "",
    INDEX(DATA!$B:$B, MATCH(index!$C3, DATA!$A:$A,0))
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM