ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sum a column is criteria in two in column and other column are met (https://www.excelbanter.com/excel-worksheet-functions/254190-sum-column-criteria-two-column-other-column-met.html)

John

Sum a column is criteria in two in column and other column are met
 
My formula:
=COUNT(IF(AND('Jan UA'!$C:$C,"ORD",'Jan UA'!$P:$P,M3),COUNT('Jan UA'!$P:$P)))

I want to Count all the cells in column P when column C = ORD and column P =
what is in M3

Ashish Mathur[_2_]

Sum a column is criteria in two in column and other column are met
 
Hi,

Try this

=sumproduct(('Jan UA'!$C$2:$C$5000="ORD")*('Jan UA'!$P2:$P5000=M3))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"John" wrote in message
...
My formula:
=COUNT(IF(AND('Jan UA'!$C:$C,"ORD",'Jan UA'!$P:$P,M3),COUNT('Jan
UA'!$P:$P)))

I want to Count all the cells in column P when column C = ORD and column P
=
what is in M3



Jacob Skaria

Sum a column is criteria in two in column and other column are met
 
Hi John

When you have multiple criteria use SUMPRODUCT()
=SUMPRODUCT((C1:C1000="ORD")*(P1:P1000=M3))

If you are using Excel 2007 check out help on COUNTIFS()
=COUNTIFS( Criteriarange1,Criteria1,Criteriarange2,Criteria2, ...)

--
Jacob


"John" wrote:

My formula:
=COUNT(IF(AND('Jan UA'!$C:$C,"ORD",'Jan UA'!$P:$P,M3),COUNT('Jan UA'!$P:$P)))

I want to Count all the cells in column P when column C = ORD and column P =
what is in M3



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

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