+ Reply to Thread
Results 1 to 4 of 4

Asterisk Wildcard in IF statement problem

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    2

    Asterisk Wildcard in IF statement problem

    I am trying to use the following formula to return data in Excel 2010:

    =IF( P150="5*",LEFT(P150,6),VLOOKUP(O150,Sheet9!$A$2:$S$1736,19,FALSE))

    P150 = 500121VA-MA-45

    I get an #N/A error because there is not a match in the lookup, but I would think that I would get a return for Cell P150 of 500121.

    I use wildcards in MSAccess with no problem.

    Can anyone please help?

    Last edited by shaft; 09-18-2012 at 05:47 PM. Reason: add version of Excel

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Asterisk Wildcard in IF statement problem

    Wildcards only work in certain functions (like COUNTIF,VLOOKUP,MATCH and others), when you say

    =P150="5*"

    That's TRUE only if P150 literally contains 5*

    Try using LEFT, i.e.

    =IF(LEFT(P150)="5",LEFT(P150,6),VLOOKUP(O150,Sheet9!$A$2:$S$1736,19,FALSE))
    Audere est facere

  3. #3
    Registered User
    Join Date
    09-18-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    2

    Cool Re: Asterisk Wildcard in IF statement problem

    Thanks daddylonglegs, works like a charm. I have been struggling with this for a while.

    Regards,
    Shaft

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Asterisk Wildcard in IF statement problem

    @ shaft

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1