Solved

Wildcard not working in Excel match statement

Posted on 2010-08-28
7
690 Views
Last Modified: 2012-05-10
I have a match statement in Excel and the wildcard does not work.  Is a wildcard (*) not allowed in a match statement?
0
Comment
Question by:morinia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 58

Expert Comment

by:cyberkiwi
ID: 33551198
No it doesn't.  Are you trying to match any cell that is non-blank, hence the *?
If you can describe what you actually want to do in more detail, we will work out a formula for you.
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 33551214
When using the exact match option with the MATCH function (passing 0 for the third parameter), wildcard characters are allowed. Otherwise wildcard characters are not allowed.

Kevin
0
 

Author Comment

by:morinia
ID: 33551225
Originally I was trying to use this statement to match if the column had "NJ*" in the first two positions followed by any other combination of letters.  It if didn't I would default to "NY".  Since there were only five choices I just put the entire literal in.   I also noticed the "If False" did not work like I wanted it to, so I used iferror to default to New York.

=IFERROR(IF(MATCH(VLOOKUP(INDIRECT($C$1),INFOTAB,2,FALSE),{"NJ*"},0),"NEW JERSEY","NEW YORK"),"NEW YORK")
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 33551249
You have the MATCH backwards. You are trying to match a value to an array containing wildcard characters. You can't do that. You can only use wildcard characters in the value for which you are searching or the first parameter. This should work:

   =IF(LEFT(VLOOKUP(INDIRECT($C$1),INFOTAB,2,FALSE),2)="NJ","NEW JERSEY","NEW YORK")

Kevin
0
 

Author Comment

by:morinia
ID: 33551264
Kevin,

Where is the wildcard?
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 250 total points
ID: 33551268
You don't need it. You are only testing the first two characters of the lookup value. It's simpler than you thought ;-)

Kevin
0
 

Author Closing Comment

by:morinia
ID: 33551275
Thanks!!  
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question