ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Count matches within two columns (https://www.excelbanter.com/excel-discussion-misc-queries/196112-count-matches-within-two-columns.html)

J.W. Aldridge

Count matches within two columns
 
On sheet 2....I have a lookup name in cell A1, and a lookup time
(hour) in B1.

On sheet 1, I have a list of names in A:A, and a list of (hours) in
C:C.

How do I count the number of matches between the two?



AMY 12
AMY 15
BRUCE 12
BRUCE 22
AMY 12
AMY 12
AMY 12
BRUCE 33
AMY 23


So the formula would look up how many AMY are in the same row as 12
which equals 4.

Thanx

RagDyeR

Count matches within two columns
 
Try this formula in *either* Sheet1 or Sheet2:

=SUMPRODUCT((Sheet1!A1:A9=Sheet2!A1)*(Sheet1!B1:B9 =Sheet2!B1))
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===


"J.W. Aldridge" wrote in message
...
On sheet 2....I have a lookup name in cell A1, and a lookup time
(hour) in B1.

On sheet 1, I have a list of names in A:A, and a list of (hours) in
C:C.

How do I count the number of matches between the two?



AMY 12
AMY 15
BRUCE 12
BRUCE 22
AMY 12
AMY 12
AMY 12
BRUCE 33
AMY 23


So the formula would look up how many AMY are in the same row as 12
which equals 4.

Thanx




All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com