【问题标题】:How to find different values within a group in Excel如何在Excel中的组中查找不同的值
【发布时间】:2019-03-12 09:30:00
【问题描述】:

我需要在 Excel 中编写一些函数,可以在 Excel 表中按组搜索不同的值。而且我找不到其他可以帮助我解决问题的类似问题。

例如:

Group1  0.3  
Group1  0.3  
Group1  0.2  
Group1  0.3  
Group1  0.3  
Group1  0.3  
Group2  0.5  
Group2  0.5  
Group2  0.5  
Group2  0.5  
Group2  0.5  
Group2  0.5  

其中 Group1 不完全相同,Group2 都为 0.5。我需要编写一些函数来查找和标记值不完全相同的组。我的预期结果是:

Group1  0.3 "Not all the same in this group"  
Group1  0.3 "Not all the same in this group"  
Group1  0.2 "Not all the same in this group"  
Group1  0.3 "Not all the same in this group"  
Group1  0.3 "Not all the same in this group"  
Group1  0.3 "Not all the same in this group"  
Group2  0.5 "Same"  
Group2  0.5 "Same"  
Group2  0.5 "Same"  
Group2  0.5 "Same"  
Group2  0.5 "Same"  
Group2  0.5 "Same"  

【问题讨论】:

    标签: excel excel-formula


    【解决方案1】:

    或者

    =IF(COUNTIF(A$2:A$100,A2)=COUNTIFS(A$2:A$100,A2,B$2:B$100,B2),"Same in this group","Not all the same in this group")
    

    【讨论】:

      【解决方案2】:

      请尝试:

      =IF(MAX(IF(A:A=A1,B:B))=MIN(IF(A:A=A1,B:B)),"Same","Not all the same in this group")  
      

      在第 1 行作为数组公式输入(使用 Ctrl+Shift+Enter)并复制下来以适应。 假设您的数据从 A1 和 B1 开始。

      【讨论】:

        【解决方案3】:

        不使用数组公式

        如果数据从 A1 开始。 C1下面的地方拖到下面

        C1 =IF(SUMIFS($B$1:$B$12,$A$1:$A$12,A2)=COUNTIFS($A$1:$A$12,A2)*B2,"same","不是全部本组也一样”)

        【讨论】:

          【解决方案4】:

          如果值都相同,则“Sumif”除以“Countif”应得到与“me”相同的值。所以像这样(假设我们从“f11”开始):

          =IF(SUMIF(F$11:F$22,F11,G$11:G$22)/COUNTIF(F$11:F$22,F11)=G11,"same","different")
          

          【讨论】:

          • 嗯“-1”?也许投反对票的人不喜欢这个解决方案;但它奏效了。我对此有点陌生..我们应该否决可行的解决方案吗?
          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-12-01
          • 2017-08-16
          • 1970-01-01
          • 2019-04-05
          相关资源
          最近更新 更多