The SEARCHB function locates one text string within a second text string, and returns the number of the starting position of the first text string from the first character of the second text string.

SEARCHB takes 2 required arguments and 1 optional argument:

Syntax: SEARCHB(find_text, within_text, [start_num])

#1)
Using the SEARCHB function:
#2)
The arguments for the SEARCHB function are:
Argument Required? Description
find_text Required The text you want to find.
within_text Required The text in which you want to search for the value of the find_text argument.
start_num Optional The character number in the within_text argument at which you want to start searching.
#3)
Quite a few more things:
The SEARCH and SEARCHB functions are not case sensitive. If you want to do a case sensitive search, you can use FIND and FINDB.
You can use the wildcard characters — the question mark (?) and asterisk (*) — in the find_text argument. 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.
If the value of find_text is not found, the #VALUE! error value is returned.
If the start_num argument is omitted, it is assumed to be 1.
If start_num is not greater than 0 (zero) or is greater than the length of the within_text argument, the #VALUE! error value is returned.
Use start_num to skip a specified number of characters. Using the SEARCH function as an example, suppose you are working with the text string "A21829.Apples". To find the number of the first "A" in the second part of the text string, set start_num equal to 7 so that the serial-number portion of the text is not searched. The SEARCH function starts the search operation at the eighth character position, finds the character that is specified in the find_text argument at the next position, and returns the number 9. The SEARCH function always returns the number of characters from the start of the within_text argument, counting the characters you skip if the start_num argument is greater than 1.

Summary

The SEARCHB function locates one text string within a second text string, and returns the number of the starting position of the first text string from the first character of the second text string.
comments powered by Disqus