ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Searching a text string in a range of cells. (https://www.excelbanter.com/excel-worksheet-functions/105086-searching-text-string-range-cells.html)

heenanmc

Searching a text string in a range of cells.
 
How do i search for something within a text string in a cell which is in a
range of cells.

so if a cell contains the names "jim, bob, tom" what formula can i use to
just search for "bob"
I am currently using a SUMIF function which is only picking up cells that
only contain "bob" on its own.

Toppers

Searching a text string in a range of cells.
 
=SUMIF(A1:A8,"*bob*",C1:C8)

will sum values in C1:C8 where A1:A8 contain "bob"

=COUNTIF(A1:A8,"*bob*")

will count occurences of "bob" in A1:A8 BUT only one occurence per cell i.e.
"bob,tom,jim,bob" in a cell will count as 1

HTH

"heenanmc" wrote:

How do i search for something within a text string in a cell which is in a
range of cells.

so if a cell contains the names "jim, bob, tom" what formula can i use to
just search for "bob"
I am currently using a SUMIF function which is only picking up cells that
only contain "bob" on its own.


heenanmc

Searching a text string in a range of cells.
 
Thank you very much! That worked perfectly!

"Toppers" wrote:

=SUMIF(A1:A8,"*bob*",C1:C8)

will sum values in C1:C8 where A1:A8 contain "bob"

=COUNTIF(A1:A8,"*bob*")

will count occurences of "bob" in A1:A8 BUT only one occurence per cell i.e.
"bob,tom,jim,bob" in a cell will count as 1

HTH

"heenanmc" wrote:

How do i search for something within a text string in a cell which is in a
range of cells.

so if a cell contains the names "jim, bob, tom" what formula can i use to
just search for "bob"
I am currently using a SUMIF function which is only picking up cells that
only contain "bob" on its own.



All times are GMT +1. The time now is 04:44 PM.

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