# countif?

#### llmikegood

##### New Member
How do I count the occurences of a value in one column based on the value in the same row of another column. Example: how many employees that are Part time are available on weekends??

employment status available weekend (yes,no,maybe)
joe pt y
dave pt y
mary pt n
tim pt m
dfa ft y
afaf ft m
dyhyh ft n
ffffsss ft y

### Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

#### Smitty

##### Legend
Welcome to the Board!

How's this:

=SUMPRODUCT(--(B1:B10="pt"),--(C1:C10="y"))

You could also use range references for "pt" & "y".

Hope that helps,

Smitty

#### Packman

##### New Member
In the formula solution for this (which works very well and I was able to use it to solve a completely different issue), what does the "--" do in the formula? What does that designate?

Replies
5
Views
434
Replies
4
Views
350
Replies
6
Views
896
Replies
13
Views
811
Replies
4
Views
263

1,171,686
Messages
5,876,890
Members
433,217
Latest member

### 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.

### Which adblocker are you using?

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

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