简体   繁体   English

计算A列中的行数,该行数在工作表2的B列的列表中具有值

[英]Count number of rows in column A that have a value in a list in column B on worksheet 2

I have a list of 3 digit phone codes in EST timezone in column A Sheet 2. I have in Column A Sheet 1 another list of 3 digit phone codes from people that have called in. 我在EST时区的A列表2中列出了3位数的电话代码。我在列A表1中列出了来自已拨打电话的人的3位电话代码。

What I am trying to do is in Sheet 1 "B2" count the number of inbound calls (Column A Sheet 1) that exist in the EST timezone list (Column A Sheet 2). 我要做的是在Sheet 1“B2”中计算EST时区列表中存在的入站呼叫数(A列表1)(A列表2)。

I cannot seem to find a way to complete this using either formulas or macros. 我似乎找不到使用公式或宏来完成此操作的方法。

You'll want something like this: 你会想要这样的东西:

=COUNTIF(A:A,'Sheet2'!A##)

Just replace A## with the location of the 3 digit code from sheet 2 that you want to count. 只需将A##替换为您要计算的工作表2中3位数代码的位置即可。

EDIT: Here is the code which solves your question. 编辑:这是解决您的问题的代码。 It counts the number of times any value within Sheet2!A:A is iterated in Sheet1!A:A 它计算Sheet2中任何值的次数!A:A在Sheet1中迭代!A:A

=SUM(COUNTIF(Sheet1!A:A,Sheet2!A:A))

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

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