简体   繁体   English

文本字符串中的Excel *符号

[英]Excel * symbol in a text string

Does the ' * ' symbol in a text string mean that there can be any characters in the string in the place of ' * '? 文本字符串中的'*'符号是否意味着字符串中可以在'*'位置存在任何字符? For some reason it doesn't work in the following code: 由于某些原因,它在以下代码中不起作用:

=COUNTIF(Workbook1!I2:I5000;"2012.01*")

Is there an alternative way to achieve what I need? 有没有其他方法可以满足我的需求?

If you are matching strings then this is fine 如果您要匹配字符串,那很好
=COUNTIF(Workbook1!I2:I5000;"2012.01*")

If you are matching against numbers then your formula above wont work try this instead 如果您要匹配数字,那么您的上述公式将无法正常工作,请尝试使用此方法
=COUNTIF(Workbook1!I2:I5000,">=2012.01")

To match only numbers starting with 2012.01 And less than 2012 仅匹配从2012.01开始且小于2012的数字

in xl07 and onwards 在xl07及更高版本中
=COUNTIFS(Workbook1!I2:I5000,">=2012.01",Workbook1!I2:I5000,"<2012.02")

all versions including xl03 所有版本,包括xl03
=SUMPRODUCT(--(Workbook1!I2:I5000>=2012.01),--(Workbook1!I2:I5000<2012.02))

Yes, the COUNTIF() function can take wildcards. 是的,COUNTIF()函数可以使用通配符。 Your problem seems to be that the syntax of your formula is incorrect. 您的问题似乎是公式的语法不正确。

=COUNTIF(I2:I5000,"2012.01*")

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

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