ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Conditional COUNTIF (https://www.excelbanter.com/excel-discussion-misc-queries/230782-conditional-countif.html)

sara

Conditional COUNTIF
 
What is wrong with this formula

IF(COUNTIF($AQ2:$BB2,OR("ABC","DEF")),"T","F")

Simon Lloyd[_230_]

Conditional COUNTIF
 

Sara;344766 Wrote:
What is wrong with this formula

IF(COUNTIF($AQ2:$BB2,OR("ABC","DEF")),"T","F")You can't use the OR operator like that you need to use an array like

this:
=IF(COUNTIF($AQ2:$BB2,{"ABC","DEF"}),"T","F")


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=96462


Simon Lloyd[_231_]

Conditional COUNTIF
 

Simon Lloyd;344786 Wrote:
You can't use the OR operator like that you need to use an array like
this:
=IF(COUNTIF($AQ2:$BB2,{"ABC","DEF"}),"T","F")Ignor e that rubbish i just sent you - don't know why i did that, its

early hours of the morning here, use this:
=IF(OR(COUNTIF($AQ2:$BB2,"ABC"),COUNTIF($AQ2:$BB2, "DEF")),"T","F")


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=96462


T. Valko

Conditional COUNTIF
 
Try it like this:

=IF(SUM(COUNTIF($AQ2:$BB2,{"ABC","DEF"})),"T","F")

--
Biff
Microsoft Excel MVP


"Sara" wrote in message
...
What is wrong with this formula

IF(COUNTIF($AQ2:$BB2,OR("ABC","DEF")),"T","F")




Max

Conditional COUNTIF
 
Here's one alternative which serves your underlying intents:
=IF(SUMPRODUCT(--ISNUMBER(MATCH($AQ2:$BB2,{"ABC","DEF"},0))),"T","F ")
Success? Pl click the YES button below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:370 Subscribers:68
xdemechanik
---
"Sara" wrote:
What is wrong with this formula
IF(COUNTIF($AQ2:$BB2,OR("ABC","DEF")),"T","F")



All times are GMT +1. The time now is 11:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com