Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I'm trying to engineer a function that counts the number of rows which have a
certain string in any cell. The string could appear in any of about nine different cells within each row. I thought this would be easy using COUNTIF inside SUMPRODUCT, but I am not quite getting it. TIA. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi!
Kind of light on details......... Assume the range is A1:I5. The string = "try". Entered as an array using the key combination of CTRL,SHIFT,ENTER: =SUM(--(MMULT(--(A1:I5="try"),TRANSPOSE(COLUMN(A1:I5)^0))0)) Biff "andy62" wrote in message ... I'm trying to engineer a function that counts the number of rows which have a certain string in any cell. The string could appear in any of about nine different cells within each row. I thought this would be easy using COUNTIF inside SUMPRODUCT, but I am not quite getting it. TIA. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
OMG, thank you (and Harlan), I guess this wasn't so straightforward after all.
"Biff" wrote: Hi! Kind of light on details......... Assume the range is A1:I5. The string = "try". Entered as an array using the key combination of CTRL,SHIFT,ENTER: =SUM(--(MMULT(--(A1:I5="try"),TRANSPOSE(COLUMN(A1:I5)^0))0)) Biff "andy62" wrote in message ... I'm trying to engineer a function that counts the number of rows which have a certain string in any cell. The string could appear in any of about nine different cells within each row. I thought this would be easy using COUNTIF inside SUMPRODUCT, but I am not quite getting it. TIA. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You're welcome!
Biff "andy62" wrote in message ... OMG, thank you (and Harlan), I guess this wasn't so straightforward after all. "Biff" wrote: Hi! Kind of light on details......... Assume the range is A1:I5. The string = "try". Entered as an array using the key combination of CTRL,SHIFT,ENTER: =SUM(--(MMULT(--(A1:I5="try"),TRANSPOSE(COLUMN(A1:I5)^0))0)) Biff "andy62" wrote in message ... I'm trying to engineer a function that counts the number of rows which have a certain string in any cell. The string could appear in any of about nine different cells within each row. I thought this would be easy using COUNTIF inside SUMPRODUCT, but I am not quite getting it. TIA. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
andy62 wrote...
I'm trying to engineer a function that counts the number of rows which have a certain string in any cell. The string could appear in any of about nine different cells within each row. I thought this would be easy using COUNTIF inside SUMPRODUCT, but I am not quite getting it. TIA. As long as you're not trying to search all 65536 rows, you could use something like the following array formula. =SUM(--(MMULT(-ISNUMBER(SEARCH("*XyZ*",Rng)),TRANSPOSE(COLUMN(Rng )))<0)) This uses only nonvolatile functions. At th |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
andy62 wrote...
I'm trying to engineer a function that counts the number of rows which have a certain string in any cell. The string could appear in any of about nine different cells within each row. I thought this would be easy using COUNTIF inside SUMPRODUCT, but I am not quite getting it. TIA. As long as you're not trying to search all 65536 rows, you could use something like the following array formula. =SUM(--(MMULT(-ISNUMBER(SEARCH("*XyZ*",Rng)),TRANSPOSE(COLUMN(Rng )))<0)) This uses only nonvolatile functions. At the cost of some performance, you could use OFFSET to shorten the the array formula. =SUM(--(COUNTIF(OFFSET(Rng,ROW(Rng)-MIN(ROW(Rng)),0,1,),"*XyZ*")0)) That's not much shorter, so I'd prefer the longer, nonvolatile formula myself. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
List File Properties - Author | Excel Worksheet Functions | |||
Help with this conditional IF statement | Excel Discussion (Misc queries) | |||
resetting last cell | Excel Discussion (Misc queries) | |||
copying cell names | Excel Discussion (Misc queries) | |||
Convert rows into 1 cell or 1 string | Excel Worksheet Functions |