ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   wildcards in formulas (https://www.excelbanter.com/excel-discussion-misc-queries/52733-wildcards-formulas.html)

GoBobbyGo

wildcards in formulas
 
How do I get a formula to include a wildcard?

For example, the remarks on the MATCH function say:

If match_type is 0 and lookup_value is text, lookup_value can contain the
wildcard characters asterisk (*) and question mark (?). An asterisk matches
any sequence of characters; a question mark matches any single character.

So I created a spreadsheet, and put the word "bananas" in cell b2.

I then find that =MATCH("bananas",b1:b5,0) gives me 2
But =MATCH("ba*s",b1:b5,0) gives me #N/A, and taking the asterisk out of the
quotes (=MATCH("ba" & * & "s",b1:b5,0), for example), gets me a formula error.

So what's the proper syntax for getting that asterisk in there?

Bob Phillips

wildcards in formulas
 
That is the proper syntax, and works perfectly for me. You don't have a
trailing space by any chance?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"GoBobbyGo" wrote in message
...
How do I get a formula to include a wildcard?

For example, the remarks on the MATCH function say:

If match_type is 0 and lookup_value is text, lookup_value can contain the
wildcard characters asterisk (*) and question mark (?). An asterisk

matches
any sequence of characters; a question mark matches any single character.

So I created a spreadsheet, and put the word "bananas" in cell b2.

I then find that =MATCH("bananas",b1:b5,0) gives me 2
But =MATCH("ba*s",b1:b5,0) gives me #N/A, and taking the asterisk out of

the
quotes (=MATCH("ba" & * & "s",b1:b5,0), for example), gets me a formula

error.

So what's the proper syntax for getting that asterisk in there?





All times are GMT +1. The time now is 02:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com