简体   繁体   English

Excel函数-如果没有结果,则将单元格设置为“ 0”

[英]Excel function - if no results then make the cell '0'

How can I edit this array function to make the result display 0 instead of #N/A if there are no results? 如果没有结果,如何编辑此数组函数以使结果显示为0而不是#N / A? I've tried using IF statements with it but can't get it it work... 我已经尝试过使用IF语句,但是无法正常工作...

=INDEX(INDIRECT("'"&I18&"'!$h$1:$h$999"),MATCH(1,(INDIRECT("'"&I18&"'!$a$1:$a$999")="Last 20 Games by Venue")*(INDIRECT("'"&I18&"'!$b$1:$b$999")=O18),0))

In Excel 2007 you can just wrap an IFERROR function around your formula - the syntax is 在Excel 2007中,您可以将IFERROR函数包装在公式周围-语法为

=IFERROR(original_formula,default_result)

so to get zero instead of #N/A use this version 因此要获取零而不是#N / A,请使用此版本

=IFERROR(INDEX(INDIRECT("'"&I18&"'!$h$1:$h$999"),MATCH(1,(INDIRECT("'"&I18&"'!$a$1:$a$999")="Last 20 Games by Venue")*(INDIRECT("'"&I18&"'!$b$1:$b$999")=O18),0)),0)

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

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