+ Reply to Thread
Results 1 to 6 of 6

Multi-Conditional with Wildcards...

  1. #1
    Registered User
    Join Date
    06-15-2009
    Location
    Queretaro, Mexico
    MS-Off Ver
    Excel 2003
    Posts
    19

    Multi-Conditional with Wildcards...

    Hi everyone, my problem is as follows (can use a formula or VBA code):

    I've got a column with client codes (col. B) and another one with material codes (col. C). Both columns mix numbers and text.

    First condition: If cells in "B" column equal a specific code ("DA2")

    Second condition: AND If the cells in "C" column start with a certain pattern ("30") followed by some other pattern (four random digits, a dash, and two or three more random digits)

    THEN a new cell should say "T1", Else it should just copy another cell.


    I now it might be a bit hard to visualize, therefore I'm attaching a sample worksheet to simplify my problem.

    Cheers,
    Kianuz.
    Attached Files Attached Files
    Last edited by Kianuz; 06-23-2009 at 05:22 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Multi-Conditional with Wildcards...

    This should work I think

    Please Login or Register  to view this content.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Multi-Conditional with Wildcards...

    Try:

    =IF(AND(B4="DA2",LEFT(C4,2)="30",ISNUMBER(MID(C4,3,4)+0),MID(C4,7,1)="-",OR(ISNUMBER(MID(C4,8,2)+0),ISNUMBER(MID(C4,8,3)+0))),"TI",D4)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    06-15-2009
    Location
    Queretaro, Mexico
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Multi-Conditional with Wildcards...

    The solutions worked perfectly, I'm grateful for the speed and accuracy with which u guys helped.

    I've got one more question however (for a problem I just noticed):

    How could I change the formula to say that instead of $B4="DA2", $B4 starts with "DA" (because the above solution should be applied to all clients that start with DA (not in sample file), and I just noticed...)

    Thanks again guys!!
    Last edited by Kianuz; 06-23-2009 at 02:18 PM.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Multi-Conditional with Wildcards...

    Replace $B4="DA2" with LEFT($B4,2)="DA"

  6. #6
    Registered User
    Join Date
    06-15-2009
    Location
    Queretaro, Mexico
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Multi-Conditional with Wildcards...

    Kudos NBVC, saved me a bunch of calculations.

    Cheers,
    Kianuz

+ 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