Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Is there any code to find a phrase (that i enter into cell E1) within a cell. For example if B2 holds "The Cat in the hat" B3 holds "The Cat in the Car" B4 holds "The Dog in the Bush" B5 holds "Harry and the monkey" I want to search for the number of cells that hold the phrase "in the". In this case that'd be 3 Is it possible to do this? Thanks in advance Niko |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In cell E1:
=COUNT(FIND("in the",B2:B5)) Enter as an array formula (control-shift-enter) Note that this is case sensitive, and will not match "In the" or "in The" HTH, Keith "N1KO" wrote: Hi, Is there any code to find a phrase (that i enter into cell E1) within a cell. For example if B2 holds "The Cat in the hat" B3 holds "The Cat in the Car" B4 holds "The Dog in the Bush" B5 holds "Harry and the monkey" I want to search for the number of cells that hold the phrase "in the". In this case that'd be 3 Is it possible to do this? Thanks in advance Niko |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=(LEN(B2&B3&B4&B5)-LEN(SUBSTITUTE(B2&B3&B4&B5,"in the","")))/6
-- Gary''s Student - gsnu200903 "N1KO" wrote: Hi, Is there any code to find a phrase (that i enter into cell E1) within a cell. For example if B2 holds "The Cat in the hat" B3 holds "The Cat in the Car" B4 holds "The Dog in the Bush" B5 holds "Harry and the monkey" I want to search for the number of cells that hold the phrase "in the". In this case that'd be 3 Is it possible to do this? Thanks in advance Niko |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This worked but is going to be way too long for the range i need.
Thanks though. Niko "Gary''s Student" wrote: =(LEN(B2&B3&B4&B5)-LEN(SUBSTITUTE(B2&B3&B4&B5,"in the","")))/6 -- Gary''s Student - gsnu200903 "N1KO" wrote: Hi, Is there any code to find a phrase (that i enter into cell E1) within a cell. For example if B2 holds "The Cat in the hat" B3 holds "The Cat in the Car" B4 holds "The Dog in the Bush" B5 holds "Harry and the monkey" I want to search for the number of cells that hold the phrase "in the". In this case that'd be 3 Is it possible to do this? Thanks in advance Niko |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use this normally entered formula...
=COUNTIF(B2:B5,"*"&E1&"*") -- Rick (MVP - Excel) "N1KO" wrote in message ... Hi, Is there any code to find a phrase (that i enter into cell E1) within a cell. For example if B2 holds "The Cat in the hat" B3 holds "The Cat in the Car" B4 holds "The Dog in the Bush" B5 holds "Harry and the monkey" I want to search for the number of cells that hold the phrase "in the". In this case that'd be 3 Is it possible to do this? Thanks in advance Niko |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to you all I'll have a go through these in the morning.
Niko |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Worksheet Functions | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Programming | |||
NEED VBA TO SELECT A CELL; NOTE THE CELL VALUE;COPYADJ CELL;FIND CELL VALUE IN A RANGE AND SO ON | Excel Programming | |||
How to create/run "cell A equals Cell B put Cell C info in Cell D | Excel Discussion (Misc queries) |