* in a MATCH is by default a wildcard character...
Consider
A1: I like to buy cars I really do
A2: I like *cars*!
A3: I like cars
Let's say I want to find the first instance in which the phrase "cars" appears... I can't use:
all of the time because on occasion this phrase may be embedded within the strings...
in the MATCH function we can however make use of wildcards, and in particular the * (ie anything)
The above will return 1 as the phrase can be found embedded within the string in A1.
Note the use of * phrase * ... this equates to:
anythingcarsanything
If I were to change the function and remove the 2nd asterisk
my criteria is now in effect
anythingcars
This will now return 3 as only A3 contains the string "cars" followed by nothing (both A1 & A2 have things appearing post "cars" and are thus excluded).
Now getting on (finally) to your point... given we now know the role of * as a wildcard how can we search for an asterisk literally ? ie how can I find the literal phrase *cars* (A2) ...
To use an asterisk literally we precede with tilde (~), eg:
so our criteria now says
anything*cars*anything
ie the first and last asterisks used act as standard wildcards (not preceded by tilde) however the 2nd and 3rd instances are preceded with tilde meaning we're looking for them as literal characters.
So in the formula:
We're trying to find the first string which begins with an asterisk literally, ie
*anything
This will find for us the department footer which we can append to the primary code thereby giving us a unique codedept identifier.
Bookmarks