[英]How to count cells that cointain a “string”
I have a spreadsheet containing 2800+ rows of server names. 我有一个包含2800多个服务器名称行的电子表格。 When we decommission a server the server name is appended with ".decom".
当我们停用服务器时,服务器名称后会附加“ .decom”。 I need a count of how many in the column contain the ".decom".
我需要计算列中包含“ .decom”的数量。 In sql I would have used a simple "like '%decom%', but I am not sure how to do this in excel or if it is even possible.
在sql中,我会使用一个简单的“ like'%decom%',但是我不确定如何在excel中执行此操作,甚至不确定。
Use COUNTIF()
with a wildcard string. 将
COUNTIF()
与通配符字符串一起使用。 Just do this: 只要这样做:
=COUNTIF(A1:A100,"*.decom")
(Assumes your range is A1:A100
, so modify as needed.) (假设您的范围是
A1:A100
,请根据需要进行修改。)
JonH -- wild cards are not permitted in vlookup()
, however they can be used with index(match())
JonH-vlookup
vlookup()
不允许使用通配符,但是可以将它们与index(match())
eg: index( author_names!a1:a100,match("*"&c1&"*",author_names!a1:a100,0))
例如:
index( author_names!a1:a100,match("*"&c1&"*",author_names!a1:a100,0))
note the return value is the value of the first matching wild card found. 请注意,返回值是找到的第一个匹配通配符的值。
BTW: your vlookup()
example specifies 2 columns (A &B) but you're returning only the first column value (1), so my example does the same... if you really meant to return the value of the second column in the vlookup()
, change my example to 'author_names!b1:b100', immediately following 'index('.
顺便说一句:您的
vlookup()
示例指定2列(A&B),但是您仅返回第一列值(1),所以我的示例也执行相同的操作...如果您确实要返回第二列的值, 'author_names!b1:b100', immediately following 'index('.
vlookup()
,将我的示例更改为'author_names!b1:b100', immediately following 'index('.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.