# Probs with OR nested in COUNTIF function

#### 50gumbys

##### Board Regular
In a spreadsheet we are tracking two types of tasks that people do.
Within a defined range of cells, entries will either be an "I" or a "W".

We want to count the number of times either an "I" or a "W" is entered.

The calculation I thought would do the trick is:
=COUNTIF(Schedule!B11:F11,OR(i,w))

However, I'm getting errors on the OR function.

Using just the letters (I or W), I get a #NAME? error.
If I surround the letters in double quotes, I get a #VALUE! error.

I played with it and found OR accepts numerics.
But that doesn't help me here.

Is there something else I can use to achieve a count?

Thank you VERY much !!
Lori

### Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

#### Brian from Maui

##### MrExcel MVP
50gumbys said:
In a spreadsheet we are tracking two types of tasks that people do.
Within a defined range of cells, entries will either be an "I" or a "W".

We want to count the number of times either an "I" or a "W" is entered.

The calculation I thought would do the trick is:
=COUNTIF(Schedule!B11:F11,OR(i,w))

However, I'm getting errors on the OR function.

Using just the letters (I or W), I get a #NAME? error.
If I surround the letters in double quotes, I get a #VALUE! error.

I played with it and found OR accepts numerics.
But that doesn't help me here.

Is there something else I can use to achieve a count?

Thank you VERY much !!
Lori

Either,

=COUNTIF(Range,Criteria)+(COUNTIF(Range,Criteria)

or

=SUMPRODUCT(--(B11:F11={"I","W"}))

##### MrExcel MVP
Also:

=SUM(COUNTIF(Schedule!B11:F11,{"i","w"}))

#### 50gumbys

##### Board Regular
Yippeeeeeee !!!!!!!!!!!!

She works like a store-bought one!

Thank you SO much !!

#### 50gumbys

##### Board Regular
Wow!
That's a good one too!!
This is like being in a candy store!!
Thank you!!

Replies
7
Views
168
Replies
0
Views
84
Replies
3
Views
186
Replies
3
Views
111
Replies
2
Views
159

1,127,870
Messages
5,627,364
Members
416,245
Latest member
Xterminat

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