Thanks:  0
Likes:  0

# Thread: using countif without a range

1. I am trying to use a countif statement but I want don't want to look at a whole range just certain cells. I have tried different things but I keep getting an error. Here is something like I am trying.

I just want to look at cells T17, T20 and T30 but nothing in between.
=IF(COUNTIF((T17,T20,T30),"X")>0,"X","no")

If you have any suggestions let me know.
Thanks-

2. The 1st argument of COUNTIF must be a cell range. A cell range is defined as...

"To refer to a range of cells, enter the reference for the cell in the upper-left corner of the range, a colon (, and then the reference to the cell in the lower-right corner of the range."

3. Try the following:

=IF(SUMPRODUCT((T17>0)*(T20>0)*(T30>0))=1,"X","no")

4. On 2002-04-08 09:15, hawley wrote:
I am trying to use a countif statement but I want don't want to look at a whole range just certain cells. I have tried different things but I keep getting an error. Here is something like I am trying.

I just want to look at cells T17, T20 and T30 but nothing in between.
=IF(COUNTIF((T17,T20,T30),"X")>0,"X","no")

If you have any suggestions let me know.
Thanks-
It seems just an "X" in one the target cells is sufficient, to return as result an "X", otherwise a "no".

=IF(SUMPRODUCT((T17="X")+(T20="X")+(T30="X"))>0,"X","no")

would do that job.

5. On 2002-04-08 09:36, Aladin Akyurek wrote:
On 2002-04-08 09:15, hawley wrote:
I am trying to use a countif statement but I want don't want to look at a whole range just certain cells. I have tried different things but I keep getting an error. Here is something like I am trying.

I just want to look at cells T17, T20 and T30 but nothing in between.
=IF(COUNTIF((T17,T20,T30),"X")>0,"X","no")

If you have any suggestions let me know.
Thanks-
It seems just an "X" in one the target cells is sufficient, to return as result an "X", otherwise a "no".

=IF(SUMPRODUCT((T17="X")+(T20="X")+(T30="X"))>0,"X","no")

would do that job.
To me it looks like hawley wants to evalute a 4 element set consisting of {T17,T20,T30,"X"}.

6. Oops, I missed the bit about X being in there.

=IF(SUMPRODUCT((T17="X")*(T20="X")*(T30="X"))=1,"X","no")

[ This Message was edited by: Al Chara on 2002-04-08 09:54 ]

7. On 2002-04-08 09:38, Mark W. wrote:
On 2002-04-08 09:36, Aladin Akyurek wrote:
On 2002-04-08 09:15, hawley wrote:
I am trying to use a countif statement but I want don't want to look at a whole range just certain cells. I have tried different things but I keep getting an error. Here is something like I am trying.

I just want to look at cells T17, T20 and T30 but nothing in between.
=IF(COUNTIF((T17,T20,T30),"X")>0,"X","no")

If you have any suggestions let me know.
Thanks-
It seems just an "X" in one the target cells is sufficient, to return as result an "X", otherwise a "no".

=IF(SUMPRODUCT((T17="X")+(T20="X")+(T30="X"))>0,"X","no")

would do that job.
To me it looks like hawley wants to evalute a 4 element set consisting of {T17,T20,T30,"X"}.
If so, I'll try to cope.

8. Thanks for the help everyone. What I ended up using was this
IF(SUMPRODUCT((T10="X")+(T20="X")+(T30="X"))>0,"X","no")

I also found this will work but the above is less typing.
IF((COUNTIF(T10,"X")+COUNTIF(T20,"X")+COUNTIF(T30,"X"))>0,"X","no")

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•