Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Trying to find way to combine COUNTIF & EXACT with the following example,
that seems to work as is, but need to "EXACT" the same characters. thanks =IF(OR(COUNTIF(AB9:AD9,{"os","p","x"})0),0,1) |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this:
=IF(COUNTA(AB9:AD9),--(SUMPRODUCT(--(ISNUMBER(FIND({"os";"p";"x"},AB9:AD9))))=0),"") -- Biff Microsoft Excel MVP "nastech" wrote in message ... Trying to find way to combine COUNTIF & EXACT with the following example, that seems to work as is, but need to "EXACT" the same characters. thanks =IF(OR(COUNTIF(AB9:AD9,{"os","p","x"})0),0,1) |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
"T. Valko" wrote...
Try this: =IF(COUNTA(AB9:AD9), --(SUMPRODUCT(--(ISNUMBER(FIND({"os";"p";"x"},AB9:AD9))))=0),"") .... Nice try, but your FIND call will look for matches anywhere in the values of AB9:AD9, which would be similar to COUNTIF(AB9:AD9,"*"&{"os";"p";"x"}&"*"), but that's not what the OP's formula does. OP's formula performs WHOLE CONTENTS matching, just case-sensitive. And the IF(COUNTA(..) bit? Where did the OP ask for that? "nastech" wrote... Trying to find way to combine COUNTIF & EXACT with the following example, that seems to work as is, but need to "EXACT" the same characters. =IF(OR(COUNTIF(AB9:AD9,{"os","p","x"})0),0,1) If all you want is 0 when none of the three cells equals "os", "p" or "x" and 1 when one or more of these cells equal any of these text values, try the array formula =1-OR(EXACT(AB9:AD9,{"os";"p";"x"})) Unfortunately, EXACT is one of those ancient, irritating functions that can only handle array arguments when entered in array formulas. If you want to avoid array formulas, try the longer formula =1+SUMPRODUCT(-(SUBSTITUTE(B1:D1,{"os";"p";"x"},"",1)="")) |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
"Harlan Grove" wrote in message
... "T. Valko" wrote... Try this: =IF(COUNTA(AB9:AD9), --(SUMPRODUCT(--(ISNUMBER(FIND({"os";"p";"x"},AB9:AD9))))=0),"") ... Nice try, but your FIND call will look for matches anywhere in the values of AB9:AD9, which would be similar to COUNTIF(AB9:AD9,"*"&{"os";"p";"x"}&"*"), but that's not what the OP's formula does. OP's formula performs WHOLE CONTENTS matching, just case-sensitive. I don't see my reply but it must be "there" since you're picking it apart! Yes, I know FIND will match substrings BUT it will also match the full cell content if the full cell content is only "os", "p", or "x". And the IF(COUNTA(..) bit? Where did the OP ask for that? Where did they say that they wouldn't have 3 empty cells? -- Biff Microsoft Excel MVP |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
"T. Valko" wrote...
.... And the IF(COUNTA(..) bit? Where did the OP ask for that? Where did they say that they wouldn't have 3 empty cells? And if they did have 3 empty cells, then none of them would be "os", "p" or "x", so why, without reading the OP's mind (or believing you could), would that not trigger a return value of 1? |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() -- Biff Microsoft Excel MVP "T. Valko" wrote in message ... "Harlan Grove" wrote in message ... "T. Valko" wrote... Try this: =IF(COUNTA(AB9:AD9), --(SUMPRODUCT(--(ISNUMBER(FIND({"os";"p";"x"},AB9:AD9))))=0),"") ... Nice try, but your FIND call will look for matches anywhere in the values of AB9:AD9, which would be similar to COUNTIF(AB9:AD9,"*"&{"os";"p";"x"}&"*"), but that's not what the OP's formula does. OP's formula performs WHOLE CONTENTS matching, just case-sensitive. Yes, I know FIND will match substrings BUT it will also match the full cell content if the full cell content is only "os", "p", or "x". What it boils down to is that I'm using the case sensitivity of FIND versus the case sensitivity of EXACT. -- Biff Microsoft Excel MVP |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
"T. Valko" wrote...
.... "T. Valko" wrote in message .... Yes, I know FIND will match substrings BUT it will also match the full cell content if the full cell content is only "os", "p", or "x". What it boils down to is that I'm using the case sensitivity of FIND versus the case sensitivity of EXACT. Wrong. ISNUMBER(FIND("ox","grossly inaccurate")) returns TRUE, but EXACT("os","grossly inaccurate") returns FALSE. The OP's formula, though case-insensitive, was full string matching. Yours isn't. Yours could easily return false matches. Perhaps not for "os" if the cells in question would only contain 1 or 2 chars, but if they could contain 2 chars, then why couldn't they contain, say, "np" or "xl" or "xp"? The false matches would be more likely against "p" or "x". But I get it: you don't want to admit you screwed up on this one. |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Countif is not case sensitive so you cannot use that, if you only want zero
or one as a result you can simply use =--(SUMPRODUCT(--(EXACT(AB9:AD9,{"os","p","x"})))=0) -- Regards, Peo Sjoblom "nastech" wrote in message ... Trying to find way to combine COUNTIF & EXACT with the following example, that seems to work as is, but need to "EXACT" the same characters. thanks =IF(OR(COUNTIF(AB9:AD9,{"os","p","x"})0),0,1) |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
or
=--(sumproduct(--(AB9:AD9=={"os","p","x"}))=0) "Peo Sjoblom" wrote: Countif is not case sensitive so you cannot use that, if you only want zero or one as a result you can simply use =--(SUMPRODUCT(--(EXACT(AB9:AD9,{"os","p","x"})))=0) -- Regards, Peo Sjoblom "nastech" wrote in message ... Trying to find way to combine COUNTIF & EXACT with the following example, that seems to work as is, but need to "EXACT" the same characters. thanks =IF(OR(COUNTIF(AB9:AD9,{"os","p","x"})0),0,1) |
#10
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Both are actually wrong, if you replace the comma with a semicolon in the
criteria part mine will work but since the OP wanted case sensitive result yours won't work since it will count OS, Os, oS, P and X as well =--(SUMPRODUCT(--(EXACT(AB9:AD9,{"os";"p";"x"})))=0) -- Regards, Peo Sjoblom "bj" wrote in message ... or =--(sumproduct(--(AB9:AD9=={"os","p","x"}))=0) "Peo Sjoblom" wrote: Countif is not case sensitive so you cannot use that, if you only want zero or one as a result you can simply use =--(SUMPRODUCT(--(EXACT(AB9:AD9,{"os","p","x"})))=0) -- Regards, Peo Sjoblom "nastech" wrote in message ... Trying to find way to combine COUNTIF & EXACT with the following example, that seems to work as is, but need to "EXACT" the same characters. thanks =IF(OR(COUNTIF(AB9:AD9,{"os","p","x"})0),0,1) |
#11
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I shouldn't have believed Excel help
under exact it says "You can also use the double equals (==) comparison operator instead of the EXACT function to make exact comparisons. For example, =A1==B1 returns the same value as =EXACT(A1,B1)." Of course when I just tried it it would not accept the double ==. I have vauge memories of using this in the past. I currently have 2003. "Peo Sjoblom" wrote: Both are actually wrong, if you replace the comma with a semicolon in the criteria part mine will work but since the OP wanted case sensitive result yours won't work since it will count OS, Os, oS, P and X as well =--(SUMPRODUCT(--(EXACT(AB9:AD9,{"os";"p";"x"})))=0) -- Regards, Peo Sjoblom "bj" wrote in message ... or =--(sumproduct(--(AB9:AD9=={"os","p","x"}))=0) "Peo Sjoblom" wrote: Countif is not case sensitive so you cannot use that, if you only want zero or one as a result you can simply use =--(SUMPRODUCT(--(EXACT(AB9:AD9,{"os","p","x"})))=0) -- Regards, Peo Sjoblom "nastech" wrote in message ... Trying to find way to combine COUNTIF & EXACT with the following example, that seems to work as is, but need to "EXACT" the same characters. thanks =IF(OR(COUNTIF(AB9:AD9,{"os","p","x"})0),0,1) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help - I need to combine both a SUMIF and COUNTIF into one formula | Excel Worksheet Functions | |||
Do I need to combine hlookup and countif????? | Excel Worksheet Functions | |||
please help how to combine IF function with Countif function | Excel Worksheet Functions | |||
How do I combine 2 COUNTIF formulas?? | Excel Worksheet Functions | |||
How do I combine COUNTIF and AND functions in Excel | Excel Worksheet Functions |