![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Posts: 169
|
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 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
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 ( |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Try the following:
=IF(SUMPRODUCT((T17>0)*(T20>0)*(T30>0))=1,"X","no")
__________________
Kind regards, Al Chara |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
=IF(SUMPRODUCT((T17="X")+(T20="X")+(T30="X"))>0,"X","no") would do that job. |
|
|
|
|
|
|
#5 | ||
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
|
||
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
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 | |||
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
|
|||
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Apr 2002
Posts: 169
|
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") |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|