Count If

Sefty

Board Regular
Joined
Apr 5, 2022
Messages
68
Office Version
  1. 365
Platform
  1. Windows
Hello,
I want to count data with criteria (N/A), if i want count PN 1 (N/A). what is wrong with this formula ?
=IF(G3:G19="PN 1";COUNTIF(H3:H19;"N/A");0)
Thanks
natriss.xlsx
FGH
1
2
3PN 1N/A
4PN 1N/A
5PN 11
6PN 12
7PN 13
8PN 1N/A
9PN 1N/A
10PN 14
11PN 1N/A
12PN 25
13PN 26
14PN 27
15PN 2N/A
16PN 2N/A
17PN 2N/A
18PN 20
19PN 21
20
Sheet4
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Here are two ways:

mr excel questions 13.xlsm
EFGH
35PN 1N/A
45PN 1N/A
5PN 11
6PN 12
7PN 13
8PN 1N/A
9PN 1N/A
10PN 14
11PN 1N/A
12PN 25
13PN 26
14PN 27
15PN 2N/A
16PN 2N/A
17PN 2N/A
18PN 20
19PN 21
Sheet5
Cell Formulas
RangeFormula
E3E3=COUNTIFS($G$3:$G$19,"PN 1",H3:H19,"N/A")
E4E4=SUMPRODUCT((--("PN 1"=G3:G19))*(--("N/A"=H3:H19)))
 
Upvote 0
Hey Sefty,

Are you trying to check both if column G = "PN 1" AND if column H = "N/A"?

Have you tried a =COUNTIFS formula?

Excel Formula:
=COUNTIFS(G3:G19,"PN 1",H3:H19,"N/A")

Book1
GH
15
2
3PN 1N/A
4PN 1N/A
5PN 11
6PN 12
7PN 13
8PN 1N/A
9PN 1N/A
10PN 14
11PN 1N/A
12PN 25
13PN 26
14PN 27
15PN 2N/A
16PN 2N/A
17PN 2N/A
18PN 20
19PN 21
Sheet1
Cell Formulas
RangeFormula
G1G1=COUNTIFS(G3:G19,"PN 1",H3:H19,"N/A")
 
Upvote 0
Hi Sefty,

Try this:

Excel Formula:
=COUNTIFS(G3:G19,"PN 1",H3:H19,"N/A")


I hope that helps,

Doug
 
Upvote 0
Hey Sefty,

Are you trying to check both if column G = "PN 1" AND if column H = "N/A"?

Have you tried a =COUNTIFS formula?

Excel Formula:
=COUNTIFS(G3:G19,"PN 1",H3:H19,"N/A")

Book1
GH
15
2
3PN 1N/A
4PN 1N/A
5PN 11
6PN 12
7PN 13
8PN 1N/A
9PN 1N/A
10PN 14
11PN 1N/A
12PN 25
13PN 26
14PN 27
15PN 2N/A
16PN 2N/A
17PN 2N/A
18PN 20
19PN 21
Sheet1
Cell Formulas
RangeFormula
G1G1=COUNTIFS(G3:G19,"PN 1",H3:H19,"N/A")
thanks for the response, very helpful ☺️👏
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,206
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top