LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Custom function to search a string of text for certain values occuring within it

I tried to put it into a custom function, called "rcmf". This
function would have a single argument, eqn1, being a single cell that
contains a big whole string of text made up of a series of values,
which are separated variously within the cell by spaces, parentheses,
etc..

I have a list of values elsewhere, a range of cells called NF_Range.
The function is intended to return a total of all the TRUE answers for
each test of the string against each of the values listed in NF_range
list.

The function was looking as follows:


Public Function rcmnf(eqn1)


Dim v is Array(NF_range)


'comment: where NF_range is the name given to a range of cells
containing the values I wish to check the "aggregate boolean frequency"

of occurrence in the single cell the function points toward


For Each eqn1 In Selection


For i = LBound(v) To UBound(v)
cnt = Application.CountIf(cell, "*" & v(i) & "*")
totcnt = totcnt + cnt
Next


Next


End Function


When I say "aggregate boolean frequency" what I mean is take the first
value in NF_range and if it exists in the string on one or more
occasion(s), then count this as value 1 and move on to the next value
in NF_Range, and if that exists in the string on one or more
occasion(s), then count this as value 1 and add it to the previous
running total from the prior values checked in NF_Range, etc. etc.

I know this custom function isn't right, but I'm unsure about how to
proceed to
adapt your suggestion. Thank you for anyone providing thoughts already.


Any further thoughts? Thanks.

Mike

 
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
Nested formula to search a text string and return specific text Barbie Excel Worksheet Functions 10 February 21st 09 07:40 AM
Search for a text string Dan Excel Discussion (Misc queries) 1 November 10th 08 09:09 PM
search a string as substring and give adjacent values Eddy Stan Excel Worksheet Functions 1 June 23rd 08 03:05 PM
Search, find or lookup defined text in text string zzxxcc Excel Worksheet Functions 9 September 6th 07 09:37 PM
VBA function : How to search a string in another string? bibi-phoque Excel Programming 5 April 19th 05 06:24 PM


All times are GMT +1. The time now is 06:14 AM.

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"