Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Counting within a cell

Need a function that can count how many times the number 3614 is within a
single cell.
examble value from cell "3614 ref lead 3614 ref go 3614"= 3
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Counting within a cell

On Mon, 27 Oct 2008 09:11:03 -0700, cellcounting
wrote:

Need a function that can count how many times the number 3614 is within a
single cell.
examble value from cell "3614 ref lead 3614 ref go 3614"= 3


=(LEN(A1)-LEN(SUBSTITUTE(A1,"3614","")))/LEN("3614")

Obviously, you could put 3614 in some cell, and substitute that cell reference
in the above.
--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting within a cell

Try one of these:

Based on your sample...

=(LEN(A1)-LEN(SUBSTITUTE(A1,3614,"")))/LEN(3614)

However, that will return an incorrect result if the entry was something
like this:

36142 ref lead 3614 ref go 3614

This version is more robust but is still not "bullet-proof" and assumes that
there are spaces before/after the substring of interest:

=(LEN(" "&A1&" ")-LEN(SUBSTITUTE(" "&
A1&" "," 3614 ","")))/LEN(" 3614 ")

--
Biff
Microsoft Excel MVP


"cellcounting" wrote in message
...
Need a function that can count how many times the number 3614 is within a
single cell.
examble value from cell "3614 ref lead 3614 ref go 3614"= 3



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Counting within a cell

On Mon, 27 Oct 2008 13:06:20 -0400, "T. Valko" wrote:

However, that will return an incorrect result if the entry was something
like this:

36142 ref lead 3614 ref go 3614



bbbbut 3614 is contained within 36142 :-)
--ron
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting within a cell

It took me 10 minutes to decide whether or not to include that caveat and
the other formula!

--
Biff
Microsoft Excel MVP


"Ron Rosenfeld" wrote in message
...
On Mon, 27 Oct 2008 13:06:20 -0400, "T. Valko"
wrote:

However, that will return an incorrect result if the entry was something
like this:

36142 ref lead 3614 ref go 3614



bbbbut 3614 is contained within 36142 :-)
--ron





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
Counting in a cell Philip Drury Excel Discussion (Misc queries) 8 July 19th 07 03:02 PM
counting cell color help darkbearpooh1 Excel Worksheet Functions 4 January 25th 06 02:59 AM
Counting within a cell Jane Excel Worksheet Functions 2 March 31st 05 01:29 AM
Counting Entries in a Cell Sh0t2bts Excel Worksheet Functions 0 February 15th 05 10:08 AM
Counting In a Cell carl Excel Worksheet Functions 1 November 29th 04 03:03 PM


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

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

About Us

"It's about Microsoft Excel"