+ Reply to Thread
Results 1 to 12 of 12

VLOOKUP with INDIRECT and SUBSTITUTE

  1. #1
    Registered User
    Join Date
    02-08-2013
    Location
    Taunton, Somerset, UK
    MS-Off Ver
    Excel 2007
    Posts
    85

    VLOOKUP with INDIRECT and SUBSTITUTE

    Hi Guys.

    following on from my previous post, I think I'm nearly there, but can't get this to work:
    Please Login or Register  to view this content.
    I need it to do the following:
    IF B13 is blank, then be blank, Otherwise search for B13 cell content in a table name specified in cell C4. I need it to substitute the spaces in the result of C4 eg, it could be that the user selects 'Caledonia In Frame' from C4's DV list, and I need the VLOOKUP to search table 'CaledoniaInFrame'..
    =IF(Richard="Gets Help",Richard=,Richard=Keh?)

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: VLOOKUP with INDIRECT and SUBSTITUTE

    You probably should have continued in the original thread!

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: VLOOKUP with INDIRECT and SUBSTITUTE

    Maybe:
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: VLOOKUP with INDIRECT and SUBSTITUTE

    Very nearly, both of you. Wher was right: there is a bracket missing from the INDIRECT function, but one of the 3 at the end needs to go...

    =IF(B13="","",VLOOKUP(B13,INDIRECT(SUBSTITUTE($C$4," ","")),2,FALSE))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Registered User
    Join Date
    02-08-2013
    Location
    Taunton, Somerset, UK
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: VLOOKUP with INDIRECT and SUBSTITUTE

    Quote Originally Posted by Glenn Kennedy View Post
    Very nearly, both of you. Wher was right: there is a bracket missing from the INDIRECT function, but one of the 3 at the end needs to go...

    =IF(B13="","",VLOOKUP(B13,INDIRECT(SUBSTITUTE($C$4," ","")),2,FALSE))
    Perfect, Thanks - you are wonderful!!

    One more.. A bit further nested, and again I can't get it right..

    Where B13 is found as above, now I need M13 to return the price for the same search, which is found by matching C3 to the table specified in C4's row headers. So it needs to search for B13 and return a price from column matching C3:
    C4 Specifies which table to search
    C3 specifies the PG01 or PG02 etc for the quote..
    Table has headers; PG01, PG02, PG03 etc, with different prices under each
    Table Row A Contains my product codes being searched in B13
    Table Row B Contains product description (Being returned in cell For the code you helped with before)
    Table Rows D to S contain the PG (Price group) headers, with pricing under for each price group.

    I keep coming up with #Ref! errors no matter how I try it!..

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: VLOOKUP with INDIRECT and SUBSTITUTE

    Nope. I have tried to mock this up; but I'm confused. I need to see your sheet.
    Please attach a sample workbook (preferably also showing the 1st formula in place and working). Make sure there is enough data to demonstrate your need. Make sure your desired results are shown, mock them up manually if necessary. Remember to remove ALL confidential information first!!!

    However, nothing on this Forum works quite as well as you might expect. The attachment icon doesn't work any more!! (Helpful, isn't it!!). Instead, just before you submit your post, click on GO ADVANCED (near the bottom) and then scroll down to Manage Attachments to open the upload window. The relevant instructions are at the top of that screen.

  7. #7
    Registered User
    Join Date
    02-08-2013
    Location
    Taunton, Somerset, UK
    MS-Off Ver
    Excel 2007
    Posts
    85

    Thumbs up Re: VLOOKUP with INDIRECT and SUBSTITUTE

    Thanks so much for looking at this for me.
    Okay, I think it's attached now. Please see the boxes with the Red border, and the individual cell notes that have been added. In particular, I'm trying to get the right formula for cell M13 here. Your previous formula is in cell C13.

    Thanks again!
    Attached Files Attached Files

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: VLOOKUP with INDIRECT and SUBSTITUTE

    In C3, you have an extra space that's mucking things up:

    =IF(C5="Select...","Select Range & Door Style",TRIM("PG"&LEFT(C5,2)))

    In M13, use this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-08-2013
    Location
    Taunton, Somerset, UK
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: VLOOKUP with INDIRECT and SUBSTITUTE

    Quote Originally Posted by Glenn Kennedy View Post
    In C3, you have an extra space that's mucking things up:

    =IF(C5="Select...","Select Range & Door Style",TRIM("PG"&LEFT(C5,2)))

    In M13, use this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Hmm.. That works perfectly when I implement it on my own test sheet, but not on my main sheet.. something is amiss..

  10. #10
    Registered User
    Join Date
    02-08-2013
    Location
    Taunton, Somerset, UK
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: VLOOKUP with INDIRECT and SUBSTITUTE

    Quote Originally Posted by RichardJSigKits View Post
    Hmm.. That works perfectly when I implement it on my own test sheet, but not on my main sheet.. something is amiss..
    Sorted! On my main doc, my quote sheet is named differently!

    Thank you so much for your help - you are extremely kind!

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: VLOOKUP with INDIRECT and SUBSTITUTE

    Are calculation options set to manual?

    Edit: I see you found the problem!!

  12. #12
    Registered User
    Join Date
    02-08-2013
    Location
    Taunton, Somerset, UK
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: VLOOKUP with INDIRECT and SUBSTITUTE

    Quote Originally Posted by Glenn Kennedy View Post
    Are calculation options set to manual?

    Edit: I see you found the problem!!
    All sorted - Cheers!

+ 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. iferror / indirect substitute not working?
    By nimv1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-24-2016, 09:33 PM
  2. [SOLVED] Combining Formulae with INDIRECT and SUBSTITUTE
    By AliGW in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-22-2015, 11:05 AM
  3. Substitute for INDIRECT(ADDRESS)?
    By maddito in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-20-2015, 08:18 PM
  4. Replies: 4
    Last Post: 10-28-2014, 11:04 PM
  5. Indirect substitute problem
    By RooTFantastic in forum Excel General
    Replies: 1
    Last Post: 02-17-2009, 06:10 PM
  6. indirect / substitute questions
    By RooTFantastic in forum Excel General
    Replies: 1
    Last Post: 02-17-2009, 03:03 PM
  7. Indirect/Substitute in sums
    By nrage21 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-20-2008, 11:48 AM

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