简体   繁体   English

Excel 公式在样本数据上使用 countif

[英]Excel formula using countif on sample data

We want to find out how many Data00_A_Up and Data00_B_Up is there, we are not concerned about the digit which comes after A and B like A1,A2,B1,B2 and all.我们想知道有多少 Data00_A_Up 和 Data00_B_Up ,我们不关心 A 和 B 之后的数字,如 A1、A2、B1、B2 等等。 For all Data, that is Data00,Data01,...so on we need to find out how many Data_A_Up and Data_B_Up is there using formula in excel.对于所有数据,即Data00,Data01,...等等,我们需要使用excel中的公式找出有多少Data_A_Up和Data_B_Up。 I came up with this formula我想出了这个公式

=COUNTIF(A1:C10,"Data00_A?_Up") 

this will give total A_Up for Data00.这将为 Data00 提供总 A_Up。 Similarly相似地

=COUNTIF(A1:C10,"Data01_B?_Up") 

this will give total number of B_Up for Data01.这将给出 Data01 的 B_Up 总数。 Each time we have to edit this formula to Data01,Data02,etc.每次我们必须将此公式编辑为 Data01、Data02 等。 So is there any one formula to calculate everything at once.那么是否有任何一个公式可以一次计算所有内容。

Dataset数据集
在此处输入图像描述

With Microsoft 365 you may try below formula to count Up for Data00, Data01...使用 Microsoft 365,您可以尝试使用以下公式计算Up 、Data01...

=LET(x,UNIQUE(LEFT(A1:A10,SEARCH("_",A1:A10)-1)),CHOOSE({1,2},x,COUNTIFS(A1:A10,x&"*",A1:A10,"*Up")))

If you need to distinguish A and B then could try-如果您需要区分A和B,那么可以尝试-

=LET(x,UNIQUE(LEFT(A1:A10,8)),CHOOSE({1,2},x,COUNTIFS(A1:A10,x&"*",A1:A10,"*Up")))

在此处输入图像描述

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

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