Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Paul W
 
Posts: n/a
Default How can I count strings within strings

I'm trying yo count the number of occurances of a string in a variable string
e.g look for "VVN" in TDCS0/VVN/8375 or mycompany/VVN/8375 or even
mycompany/TDCS0/VVN/8375. The text does not appear in the same location each
time. so what i am looking for is countif(a1/a96="VVN anywhere in this
string")

Excel 2002

Help !





  #2   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

=COUNTIF(A1:A96,"*"&"VVN"&"*")

--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )


"Paul W" wrote in message
...
I'm trying yo count the number of occurances of a string in a variable
string
e.g look for "VVN" in TDCS0/VVN/8375 or mycompany/VVN/8375 or even
mycompany/TDCS0/VVN/8375. The text does not appear in the same location
each
time. so what i am looking for is countif(a1/a96="VVN anywhere in this
string")

Excel 2002

Help !







  #3   Report Post  
olasa
 
Posts: n/a
Default


To find the number of times VVN occures in one cell:
=(LEN(A2)-LEN(SUBSTITUTE(A2,"VVN","")))/LEN("VVN")

To find the number of times VVN occures in a range:
=SUMPRODUCT((LEN(A2:A4)-LEN(SUBSTITUTE(A2:A4,B1,"")))/LEN(B1))
Range: A2:A4
B1: "VVN"

HTH
Ola Sandström


Pictu
http://www.excelforum.com/attachment...tid=3493&stc=1


+-------------------------------------------------------------------+
|Filename: Clipboard01.jpg |
|Download: http://www.excelforum.com/attachment.php?postid=3493 |
+-------------------------------------------------------------------+

--
olasa
------------------------------------------------------------------------
olasa's Profile: http://www.excelforum.com/member.php...o&userid=17760
View this thread: http://www.excelforum.com/showthread...hreadid=378921

  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Hi Arvi,

Why did you say

=COUNTIF(A1:A96,"*"&"VVN"&"*")

instead of

=COUNTIF(A1:A96,"*VVN*")

just wondering?

Bob

"Arvi Laanemets" wrote in message
...
Hi

=COUNTIF(A1:A96,"*"&"VVN"&"*")

--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )


"Paul W" wrote in message
...
I'm trying yo count the number of occurances of a string in a variable
string
e.g look for "VVN" in TDCS0/VVN/8375 or mycompany/VVN/8375 or even
mycompany/TDCS0/VVN/8375. The text does not appear in the same location
each
time. so what i am looking for is countif(a1/a96="VVN anywhere in this
string")

Excel 2002

Help !









  #5   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi Bob


"Bob Phillips" wrote in message
...
Hi Arvi,

Why did you say

=COUNTIF(A1:A96,"*"&"VVN"&"*")

instead of

=COUNTIF(A1:A96,"*VVN*")

just wondering?


:-))) Doctors are defining it as 'professinal cretinism', I think :-)))

Seriously, I'm a bit busy today, and with my head full my own problems. I
run trough my room for a moment, checked my question in programming NG, and
meanwhile wrote an answer to OP's question. And now I have to run again!


--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )




Bob

"Arvi Laanemets" wrote in message
...
Hi

=COUNTIF(A1:A96,"*"&"VVN"&"*")

--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )


"Paul W" wrote in message
...
I'm trying yo count the number of occurances of a string in a variable
string
e.g look for "VVN" in TDCS0/VVN/8375 or mycompany/VVN/8375 or even
mycompany/TDCS0/VVN/8375. The text does not appear in the same location
each
time. so what i am looking for is countif(a1/a96="VVN anywhere in this
string")

Excel 2002

Help !











Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 8 May 18th 05 04:23 AM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 0 May 15th 05 08:14 PM
Match Last Occurrence of two numbers and Count to Previous Occurence Sam via OfficeKB.com Excel Worksheet Functions 33 April 4th 05 02:17 PM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
SUMPRODUCT Formula to Count Row of data Below Matched Criteria Sam via OfficeKB.com Excel Worksheet Functions 8 February 3rd 05 01:37 AM


All times are GMT +1. The time now is 11:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"