简体   繁体   中英

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

in xl07 and onwards
=COUNTIFS(Workbook1!I2:I5000,">=2012.01",Workbook1!I2:I5000,"<2012.02")

all versions including xl03
=SUMPRODUCT(--(Workbook1!I2:I5000>=2012.01),--(Workbook1!I2:I5000<2012.02))

Yes, the COUNTIF() function can take wildcards. Your problem seems to be that the syntax of your formula is incorrect.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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