本文介绍了根据具体标准计算Excel中的多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 如果我按照以下解释,最好: 我有一个电子表格,其中有三列: 产品名称供应商 我需要计算供应商有多少个产品名称相同。 所有帮助都是非常感激的。 谢谢, user1114330 解决方案 p>在单元格C1中粘贴此公式 = SUMPRODUCT(($ A $ 1:$ A $ 10 = A1)*($ B $ 1:$ B $ 10 = B1)) SNAPSHOT 但是,如果您还想要VBA,请参阅此 Option Explicit Sub Sample() Dim ws As Worksheet Dim lrow As Long 设置ws =表格(Sheet1) 用ws lrow = .Range(A& .Rows.Count).End(xlUp).Row .Range(C1:C& lrow).Formula == SUMPRODUCT(($ A $ 1: $ A $& lrow& _ = A1)*($ B $ 1:$ B $& lrow&= B1))结束结束Sub I looked through other questions and couldn't find what I needed.Best if I explain as followed:I have a spreadsheet that has three columns in it:Product NameVendorSome vendors have the same product. I need to count how many Product Names are identical by vendor. All help is most appreciated. Thank you,user1114330 解决方案 Paste this formula in Cell C1 =SUMPRODUCT(($A$1:$A$10=A1)*($B$1:$B$10=B1))SNAPSHOTHowever if you still want VBA, see thisOption ExplicitSub Sample() Dim ws As Worksheet Dim lrow As Long Set ws = Sheets("Sheet1") With ws lrow = .Range("A" & .Rows.Count).End(xlUp).Row .Range("C1:C" & lrow).Formula = "=SUMPRODUCT(($A$1:$A$" & lrow & _ "=A1)*($B$1:$B$" & lrow & "=B1))" End WithEnd Sub 这篇关于根据具体标准计算Excel中的多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-23 16:29