ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   count cells that meet 2 criteria (https://www.excelbanter.com/excel-worksheet-functions/191682-count-cells-meet-2-criteria.html)

Aimee

count cells that meet 2 criteria
 

What formula should I use to count how many cells in columns G,I,K,M contain
8-May and how many cells in columns H,J,L,N contain Passed (for example)?


Bob Phillips[_3_]

count cells that meet 2 criteria
 
=SUMPRODUCT((MOD(COLUMN(G2:M20)-COLUMN(G2),2)=0)*(G2:M20=--"2008-05-08")*(H2:N20="Passed"))

--
__________________________________
HTH

Bob

"aimee" wrote in message
...

What formula should I use to count how many cells in columns G,I,K,M
contain
8-May and how many cells in columns H,J,L,N contain Passed (for example)?




Spiky

count cells that meet 2 criteria
 
On Jun 18, 5:41 am, "Bob Phillips" wrote:
=SUMPRODUCT((MOD(COLUMN(G2:M20)-COLUMN(G2),2)=0)*(G2:M20=--"2008-05-08")*(H2:N20="Passed"))

--
__________________________________
HTH

Bob

"aimee" wrote in message

...



What formula should I use to count how many cells in columns G,I,K,M
contain
8-May and how many cells in columns H,J,L,N contain Passed (for example)?


Hey, Bob. Can you explain what your first argument is doing in that
formula? I don't mean to hijack, but maybe this would help the OP, too.

Bob Phillips[_3_]

count cells that meet 2 criteria
 
Because the data is offset, the first column has one set of data, the second
has another, that first test is to do an '... every other column' test (note
how the second range is offset at start and end by one column.

Although it may be overkill, the simpler formula

=SUMPRODUCT((G2:M20=--"2008-05-08")*(H2:N20="Passed"))

could allow a situation whereby say H8 had a date of th May and I8 had
Passed to be counted, which against the OPs rules.

--
__________________________________
HTH

Bob

"Spiky" wrote in message
...
On Jun 18, 5:41 am, "Bob Phillips" wrote:
=SUMPRODUCT((MOD(COLUMN(G2:M20)-COLUMN(G2),2)=0)*(G2:M20=--"2008-05-08")*(H2:N20="Passed"))

--
__________________________________
HTH

Bob

"aimee" wrote in message

...



What formula should I use to count how many cells in columns G,I,K,M
contain
8-May and how many cells in columns H,J,L,N contain Passed (for
example)?


Hey, Bob. Can you explain what your first argument is doing in that
formula? I don't mean to hijack, but maybe this would help the OP, too.





All times are GMT +1. The time now is 12:51 AM.

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