+ Reply to Thread
Results 1 to 3 of 3

Proper syntax for wildcards in an IF formula

  1. #1
    Registered User
    Join Date
    01-30-2015
    Location
    Phoenix
    MS-Off Ver
    MS Office 2010
    Posts
    21

    Proper syntax for wildcards in an IF formula

    Hello all,

    Is there a way to use wildcards in an IF formula?

    We receive spreadsheets from multiple people and like to consolidate them into one. Column (D) is where the Company name is populated. Many times the employee names trigger what populates in column (D) and in other instances the Company names are spelled a bit different and we need to consolidate these in order to put them in a pivot table as a one line item. I’m using Excel 2010.

    Is there a way to include wildcards in the below IF formula for Joe Smith, Jane Doe, Company1, Company2 and Company3, so, I don’t have to keep adding new Company names into this formula as they change?

    =IF(A1="Yes","ABC Company",IF(E1="Smith, Joe","MW",IF(E1="Doe, Jane","MW",IF(I1="MW","MW",IF(D1="Company1 LLC DBA","Company1",IF(D1="Company1 USA INC","Company1",IF(D1="Company2 International","Company2 Inc",IF(D1="Company2 Systems Inc","Company2 Inc",IF(D1="Company2 USA Inc","Company2 Inc",IF(D1="Company3 & Affiliates","Company3",IF(D1="Company3 USA Inc","Company3",D1)))))))))))


    Thank you

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,685

    Re: Proper syntax for wildcards in an IF formula

    I think you would be better off setting up a two-column table somewhere, let's say in columns AA and AB, with entries like the following:

    Company1 LLC DBA ........... Company1
    Company1 USA INC ........... Company1
    Company2 International ..... Company2 Inc
    Company2 Systems Inc ...... Company2 Inc
    Company2 USA Inc ............ Company2 Inc
    Company3 & Affiliates ........ Company3
    Company3 USA Inc ............ Company3

    Then your long formula can become:

    =IF(A1="Yes","ABC Company",IF(E1="Smith, Joe","MW",IF(E1="Doe, Jane","MW",IF(I1="MW","MW",IFERROR(VLOOKUP(D1,AA:AB,2,0),D1)))))

    You can simply add any more conversions to the bottom of this table, as the need arises. If you have a lot of names in column E, then you could take a similar approach to reduce the formula further.

    Hope this helps.

    Pete

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Proper syntax for wildcards in an IF formula

    Quote Originally Posted by phxfitness View Post
    Is there a way to use wildcards in an IF formula?
    The IF function doesn't support the use of wildcards.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with proper syntax for an IF(AND formula construct
    By indians207 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-09-2017, 03:39 PM
  2. Proper If formula syntax for above and below number
    By Smasen91 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-24-2016, 08:51 AM
  3. Proper syntax for R1C1 formula in VBA
    By hbs1558 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-28-2015, 08:40 AM
  4. Proper formula syntax for an AND statement?
    By redsab in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-21-2013, 10:58 AM
  5. Proper syntax for EV(Expected Value) formula
    By Noobraino in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-20-2012, 09:01 PM
  6. Proper syntax for a time formula
    By nicolelschramartin in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 12-07-2012, 07:16 PM
  7. [SOLVED] Proper syntax with formula in VBA
    By kcleere in forum Excel General
    Replies: 3
    Last Post: 09-06-2012, 10:44 AM

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