+ Reply to Thread
Results 1 to 4 of 4

Vlookup for text that contains quotes

  1. #1
    Registered User
    Join Date
    07-11-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Vlookup for text that contains quotes

    How can I used the vlookup function if the "lookup value" I'm trying to find in a range of data contains quotes, ex.:
    Fluorescent, (1) 18" T12 lamp

    Let's say that lookup value is in cell O10, my table array is in $A$!:$H$!100, the column index is 7; I tried this formula first:
    =VLOOKUP(O10,$A$1:$H$100,7,FALSE)
    and I get the #N/A error.

    I was going to use the substitute function to replace the " with a ? (single character wildcard), so I tried:
    =VLOOKUP(SUBSTITUTE(O16, """, "?"),$A$1:$H$140,7,FALSE)
    but that won't work either.

    Any suggestions, please? Much appreciated.

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Vlookup for text that contains quotes

    Hi,

    There is no problem using a VLOOKUP on a value containing quotes...so I'd suggest there's something else fishy going on. The reason a VLOOKUP would return #N/A is because the value isn't found.

    There may be trailing or leading spaces, which can be eliminated using the TRIM function.

    If this doesn't work, can you please upload your workbook (or a small sample of it) so that I can take a look into this problem for you?

    Thanks

  3. #3
    Registered User
    Join Date
    07-11-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Vlookup for text that contains quotes

    Hi ajryan88,

    Yes, you are correct - I had the table array set up wrong (I forgot that the lookup value needs to be somewhere in the first column of the table array, and not just any column - oops).

    Incidentally, I found that if I wanted to type out the lookup value (instead of referencing the cell containing it) I could use the char(34) function to represent the ", like this:
    =VLOOKUP(CONCATENATE("Fluorescent, (1) 18" & CHAR(34) & " T12 lamp"),$F$1:$H$141,2,FALSE)

    Thanks for your response!
    Last edited by pajordan; 09-09-2013 at 07:45 PM. Reason: Added a thank you to the replier - :)

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Vlookup for text that contains quotes

    Hi,

    That's correct, and to simplify it even further, you can just use "" within existing quotes to give you a ", so it would become
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Please don't forget to mark this thread as solved and please click on the * next to my post(s) to say thanks

+ 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] Double Quotes using Chr(34) and Extra Quotes when saving as text file
    By vamosj in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-26-2013, 12:26 PM
  2. Remove text between quotes, variable length and number of quotes
    By JP Romano in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-14-2011, 10:40 AM
  3. Export to CSV with double quotes but ignore items that have quotes
    By capnhud in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2010, 03:13 PM
  4. Replies: 2
    Last Post: 12-06-2005, 02:25 PM
  5. [SOLVED] Writing text string with imbedded quotes to a text stream
    By John Wirt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2005, 09:05 PM

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