+ Reply to Thread
Results 1 to 9 of 9

Shooting Blanks

  1. #1
    Registered User
    Join Date
    08-11-2013
    Location
    Nevada, USA
    MS-Off Ver
    Excel 2003
    Posts
    10

    Shooting Blanks

    Objective:
    1) Mid search a text string,
    2) Search for the result in column 1 of a named list and return the value of the corresponding cell in column 2,
    3) If the result is an error, return a blank.

    I am using this combination of ISERROR, MID SEARCH, and VLOOKUP:

    =IF(ISERROR(VLOOKUP(MID($A1,SEARCH(";",$A1,1)+1,SEARCH(";",$A1,SEARCH(";",$A1,1)+1)-SEARCH(";",$A1,1)),List,2,FALSE)),"",VLOOKUP(MID($A1,SEARCH(";",$A1,1)+1,SEARCH(";",$A1,SEARCH(";",$A1,1)+1)-SEARCH(";",$A1,1)),List,2,FALSE))

    It works perfectly. However, the workbook is not opening as fast as I would like. Does anybody have a more elegant (shorter, faster) formula for accomplishing the stated objective?
    Last edited by Cruiser; 08-24-2013 at 05:26 PM. Reason: Solved

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

    Re: Shooting Blanks

    If the result is a TEXT value you can try this...

    =LOOKUP("zzzzz",CHOOSE({1,2},"",VLOOKUP(MID($A1,SEARCH(";",$A1,1)+1,SEARCH(";",$A1,SEARCH(";",$E4,1)+1)-SEARCH(";",$A1,1)),List,2,0)))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    08-11-2013
    Location
    Nevada, USA
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Shooting Blanks

    Thanks for the idea. However, I do not want to change the objective to search for a particular string of text. I actually had something similar before, and greatly reduced the calculation time by doing this "universal" mid search rather than specific text string searches. The text strings being searched have a variable number of delimiters, and sometimes result in an error. That is fine, but I want an error to return a blank. The only way I could make it work was by adding the iserror.

    I am wondering if there is a faster way to accomplish the stated objective without modifying that objective in any way. I wouldn't mind changing the formula completely if it would accomplish the objective exactly as stated. Again, thanks for your input.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Shooting Blanks

    =IFERROR(VLOOKUP(MID($A1,SEARCH(";",$A1,1)+1,SEARCH(";",$A1,SEARCH(";",$A1,1)+1)-SEARCH(";",$A1,1)),List,2,FALSE),"")
    Entia non sunt multiplicanda sine necessitate

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

    Re: Shooting Blanks

    The formula I suggested is not modifying your objective in any way.

    It's just using a much more efficient error trap.

    Since your profile says you're using Excel 2003 this is about as efficient as it can get.

    This:

    LOOKUP("zzzzz",CHOOSE({1,2},"",

    Does the same thing as this (sort of!):

    IF(ISERROR(VLOOKUP(MID($A1,SEARCH(";",$A1,1)+1,SEARCH(";",$A1,SEARCH(";",$A1,1)+1)-SEARCH(";",$A1,1)),List,2,FALSE)),"",

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Shooting Blanks

    Since your profile says you're using Excel 2003 ...
    Missed that. +1 for Tony's suggestion.

  7. #7
    Registered User
    Join Date
    08-11-2013
    Location
    Nevada, USA
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Shooting Blanks

    Thanks SHG, but this formula returns an error.
    Last edited by Cruiser; 08-24-2013 at 05:10 PM.

  8. #8
    Registered User
    Join Date
    08-11-2013
    Location
    Nevada, USA
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Shooting Blanks

    Thanks Tony. I thought that was searching for a text-sub string of z's. However, it was actually the magical formula I was looking for. You are the man.
    Last edited by Cruiser; 08-24-2013 at 05:19 PM.

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

    Re: Shooting Blanks

    You're welcome. Thanks for the feedback!

+ 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. [SOLVED] sum formula trouble shooting
    By kurl01 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-03-2013, 07:43 AM
  2. Trouble Shooting VBA Vlookup
    By Decoderman in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-14-2011, 12:28 PM
  3. [SOLVED] Trouble shooting Excel?
    By meersr in forum Excel General
    Replies: 1
    Last Post: 04-15-2006, 03:15 PM
  4. Replies: 3
    Last Post: 03-01-2006, 06:30 PM
  5. trouble shooting section
    By danielle in forum Excel General
    Replies: 1
    Last Post: 04-25-2005, 06:06 PM

Tags for this Thread

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