简体   繁体   中英

Excel MATCH Function Error

I am trying to find a value containing "~" using the MATCH function, and it's returning a #N/A error.

See the below example. Cell B1 returns #N/A :

    A          B
1   ~toto      =MATCH(A1,A2:A3,0)
2   ~toto
3   ~titi

I used the RIGHT function to remove the "~", and it worked.

My problem is that I have to match values such as "~toto~tata~tutu".

Has anyone any idea how to solve this?

FYI, I can't use VBA for incompatibility reasons.

One way of doing this is by using below formula

=MATCH(TRUE,EXACT(A1,A2:A3),0)

This is an array formula so commit it by pressing Ctrl + Shift + Enter . See image for reference.

在此处输入图片说明

To take care of error if no match found use array formula as

=IFERROR(MATCH(TRUE,EXACT(A1,A2:A3),0),"")

Use:

=MATCH("~"&A1,A2:A3,0)

~ being a wildcard identifier may have something to do with it.

As noted by Pnuts, this wouldn't work if the symbol ~ appears later on in the same string. Also for some reason unknown to me it gives a match for ~tutu~tata when my lookup value is ~tutu

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM