ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Countif in two columns and in different cells (https://www.excelbanter.com/excel-discussion-misc-queries/49243-countif-two-columns-different-cells.html)

ferde

Countif in two columns and in different cells
 
I'm not sure which function I need to add text "p" and "cps" when this
data is in different columns. The total in this ex: would be p+cps = 2.
Any help would be greatly appreciated. I'm new at this.

shift class
p cps
p x
p x
p x
p cps

total p+cps = 2

PeterAtherton



"ferde" wrote:

I'm not sure which function I need to add text "p" and "cps" when this
data is in different columns. The total in this ex: would be p+cps = 2.
Any help would be greatly appreciated. I'm new at this.

shift class
p cps
p x
p x
p x
p cps

total p+cps = 2


Assuming that shift is in column A and class is in column b

=IF(AND(A2="p",B2="cps"),COUNTA(A2:B2),"")

Regards
Peter

RagDyer

Try this:

=SUMPRODUCT((A2:A100="P")*(B2:B100="cps"))

--
HTH,

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


"ferde" wrote in message
...
I'm not sure which function I need to add text "p" and "cps" when this
data is in different columns. The total in this ex: would be p+cps = 2.
Any help would be greatly appreciated. I'm new at this.

shift class
p cps
p x
p x
p x
p cps

total p+cps = 2




All times are GMT +1. The time now is 12:54 PM.

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