如果匹配语句,则返回#N/A为FALSE [英] Return FALSE for #N/A in if match statement
问题描述
如果出现匹配错误,我试图显示FALSE的值.目前,我还无法弄清楚.我对公式在Google电子表格中的工作方式还很陌生.
I am trying to show a value of FALSE if a match error comes up. Right now, I have not been able to figure it out. I am still pretty new to how formulas work in google spreadsheet.
=IF(MATCH(A16,W46:W52,0),TRUE,FALSE)
如果存在该值,则当前有效
Currently works if the value is present
我尝试过
=IF(ISNA(MATCH(A16,W46:W52,0)),FALSE,MATCH(A16,W46:W52,0),TRUE,FALSE)
当前,以上方法不起作用,并且会为if语句包含太多争论而引发错误.
Currently the above does not work and throws up an error for the if statement having too many arguements.
推荐答案
尝试
=ISNUMBER(MATCH(A16,W46:W52,0))
如果有匹配项,MATCH函数将返回该匹配项的相对位置(数字).如果没有匹配项,将返回#N/A.ISNUMBER返回一个布尔值(真或假).因此,如果存在匹配项,则返回TRUE,否则返回FALSE(因为在这种情况下,MATCH函数不会返回任何数字).
If there is a match the MATCH function will return the relative position of that match (number). If there is no match #N/A will be returned. ISNUMBER returns a boolean value (true or false). So if there is a match it will return TRUE if not it will return FALSE (because in that case there will be no number returned by the MATCH function).
这篇关于如果匹配语句,则返回#N/A为FALSE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!