ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditional count across 2 columns (https://www.excelbanter.com/excel-worksheet-functions/139106-conditional-count-across-2-columns.html)

RFJ

Conditional count across 2 columns
 
I've got a 2000 row worksheet where I want to count the number of occurences
row where two row conditions are satisifed

eg In the example below if I wanted to count where Col 1= A and Col 2 = 1,
then I'd want the answer 2 returned

A 1
B 2
A 3
C 4
A 1

In practice Col 1 has the rangename 'Place' and Col 2 has the rangename
'Customer' - if this helps answering this post

Can someone save my sanity :(

Tx in advance

Rob




Ron Coderre

Conditional count across 2 columns
 
Try something like this:

=SUMPRODUCT((Place="A")*(Customer=1))

Where "Place" and "Customer" are defined names referring to equal numbers of
cells.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"RFJ" wrote:

I've got a 2000 row worksheet where I want to count the number of occurences
row where two row conditions are satisifed

eg In the example below if I wanted to count where Col 1= A and Col 2 = 1,
then I'd want the answer 2 returned

A 1
B 2
A 3
C 4
A 1

In practice Col 1 has the rangename 'Place' and Col 2 has the rangename
'Customer' - if this helps answering this post

Can someone save my sanity :(

Tx in advance

Rob





RagDyeR

Conditional count across 2 columns
 
It's wiser to assign 2 cells to "contain" the search criteria, so that they
can be easily changed without changing the formula itself.

Say the criteria for "Place"is entered in D1, and the criteria for
"Customer" is entered in D2.

Then, try this formula:

=Sumproduct((PLace=D1)*(Customer=D2))
--

HTH,

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


"RFJ" wrote in message
...
I've got a 2000 row worksheet where I want to count the number of occurences
row where two row conditions are satisifed

eg In the example below if I wanted to count where Col 1= A and Col 2 = 1,
then I'd want the answer 2 returned

A 1
B 2
A 3
C 4
A 1

In practice Col 1 has the rangename 'Place' and Col 2 has the rangename
'Customer' - if this helps answering this post

Can someone save my sanity :(

Tx in advance

Rob





Teethless mama

Conditional count across 2 columns
 
If you have XL2007 then try this:

=COUNTIFS(Place,"A",Customer,1)


"RFJ" wrote:

I've got a 2000 row worksheet where I want to count the number of occurences
row where two row conditions are satisifed

eg In the example below if I wanted to count where Col 1= A and Col 2 = 1,
then I'd want the answer 2 returned

A 1
B 2
A 3
C 4
A 1

In practice Col 1 has the rangename 'Place' and Col 2 has the rangename
'Customer' - if this helps answering this post

Can someone save my sanity :(

Tx in advance

Rob






All times are GMT +1. The time now is 04:50 AM.

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