Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 9
Default Count Word in long string

Dears

I want to count how many specific word is repeted in long string in one cell i will give you example

Red , green , red , blue , ,black ,green , red, red,

what i want to do is to count how many times the word red repeted starting from the right hand side till the fourth coma only not through the whole sting only till the fourth coma
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Count Word in long string

Hi,

Am Sat, 23 Mar 2013 10:55:18 +0000 schrieb tamer:

Red , green , red , blue , ,black ,green , red, red,

what i want to do is to count how many times the word red repeted
starting from the right hand side till the fourth coma only not through
the whole sting only till the fourth coma


your string in A1. Then try:
=(LEN(RIGHT(A1,LEN(A1)-FIND("#",SUBSTITUTE(A1,",","#",4))-2))-LEN(SUBSTITUTE(RIGHT(A1,LEN(A1)-FIND("#",SUBSTITUTE(A1,",","#",4))-2),"red",)))/LEN("red")


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Junior Member
 
Posts: 20
Default

Quote:
Originally Posted by tamer View Post
Dears

I want to count how many specific word is repeted in long string in one cell i will give you example

Red , green , red , blue , ,black ,green , red, red,

what i want to do is to count how many times the word red repeted starting from the right hand side till the fourth coma only not through the whole sting only till the fourth coma

Will it always be until the fourth comma?
  #4   Report Post  
Junior Member
 
Posts: 20
Default

Quote:
Originally Posted by shanermuls View Post
Will it always be until the fourth comma?


If it is to the fourth comma, the following will perform the search

this searches the text in A1, counts the number of occurrences of the text in B1, up until the fourth comma

=(LEN(LEFT(A1,FIND(",",A1, FIND(",", A1,FIND(",", A1, FIND(",", A1, 1)+1) +1)+1)))-LEN(SUBSTITUTE(LOWER(LEFT(A1,FIND(",",A1, FIND(",", A1,FIND(",", A1, FIND(",", A1, 1)+1) +1)+1))),LOWER(B1),"")))/LEN(B1)
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
String-in-Cell .... too long??? Word Wrap not working...PLEASE HE Steve P[_2_] Excel Discussion (Misc queries) 3 February 19th 10 09:14 PM
Importing Long String - String Manipulation (INVRPT) (EDI EANCOM 96a) Brian Excel Programming 3 February 9th 06 03:38 PM
Importing Long String - String Manipulation (EDI EANCOM 96a) Brian Excel Programming 6 February 9th 06 12:27 PM
From String to Long MD Excel Programming 3 June 6th 05 04:44 PM
Get long value for a date string jerry chapman[_2_] Excel Programming 4 February 22nd 05 11:06 PM


All times are GMT +1. The time now is 08:10 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"