Using ~ in VLookup function

A

Andyp95

Does anyone know if VLOOKUP will recognise a ~ symbol? My datasource
contains them, and I am not having any luck getting the function to
work

Thanks
 
D

Dave Peterson

I'd try it again. Maybe something like this, too:

=VLOOKUP(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"~","~~"),"?","~?"),"*","~*"),
Sheet2!$A:$B,2,FALSE)

* and ? are wildcard characters.

The tilde tells excel to treat the asterisk as an asterisk and the question mark
as a question mark--not as wild cards.

To tell excel to treat this "escape character" as itself, you double it up.
 
Top