Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 simple excel ?

Author  Topic 

jhermiz

3564 Posts

Posted - 2005-05-19 : 14:25:47
I dont know excel and Im having trouble with a basic thing..
basically I need a way to find a string within a string
for instance I have:

=IF(FINDB("Jon", A3, 1), "yes", "no")

But if this evaluates to false I get the #VALUE error thingy...
anyone know a way to just search a string within a string and return either the true part else the false part.

Thanks,
Jon



Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]

jhermiz

3564 Posts

Posted - 2005-05-19 : 14:49:28
[code]
Find_text is the text you want to find. You can use the wildcard characters, question mark (?) and asterisk (*), in find_text. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.

Within_text is the text in which you want to search for find_text.

Start_num is the character number in within_text at which you want to start searching.

Tip

Use start_num to skip a specified number of characters. For example, suppose you are working with the text string "AYF0093.YoungMensApparel". To find the number of the first "Y" in the descriptive part of the text string, set start_num equal to 8 so that the serial-number portion of the text is not searched. SEARCH begins with character 8, finds find_text at the next character, and returns the number 9. SEARCH always returns the number of characters from the start of within_text, counting the characters you skip if start_num is greater than 1.

Remarks

SEARCH and SEARCHB do not distinguish between uppercase and lowercase letters when searching text.
SEARCH and SEARCHB are similar to FIND and FINDB, except that FIND and FINDB are case sensitive.
If find_text is not found, the #VALUE! error value is returned.
If start_num is omitted, it is assumed to be 1.
If start_num is not greater than 0 (zero) or is greater than the length of within_text, the #VALUE! error value is returned.
[/code]

From help, but how can i eliminate seeing the #VALUE! error value message ?

I need to evaluate the falst portion...I plaed with LEN() thinking that might help but without a substring it also returns VALUE! error message :(. Any excel experts ?


Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2005-05-19 : 17:42:36
You'll need to use ISERROR to trap for whether it threw an error when it could not find the value in the string. Try something like:

=IF(ISERROR(FINDB("Jon",A3)),"Not Found", "Found it!")

---------------------------
EmeraldCityDomains.com
Go to Top of Page

jhermiz

3564 Posts

Posted - 2005-05-19 : 18:35:27
quote:
Originally posted by AjarnMark

You'll need to use ISERROR to trap for whether it threw an error when it could not find the value in the string. Try something like:

=IF(ISERROR(FINDB("Jon",A3)),"Not Found", "Found it!")

---------------------------
EmeraldCityDomains.com



Great thank you so much.

Jon



Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page
   

- Advertisement -