且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查数字是否以"+"开头在Excel中?

更新时间:2023-11-26 18:29:10

尝试在COUNTIF中包含包含通配符的OR逻辑,并在IF中使用该逻辑:

Try to include OR logic including a wildcard in a COUNTIF and use that in an IF:

=IF(SUM(COUNTIF(E2,{"+*","(*","00*"})),"This","That")

如果在+前面有前导空格,则只需在条件之前添加一个空格.我想您还可以添加其他条件,例如" +*.不幸的是,TRIM()COUNTIF中无法使用.

If you got leading spaces in front of the + then just add a space before the criteria. I guess you could also add another criteria like " +*. Unfortunately TRIM() won't work within a COUNTIF.