+ Reply to Thread
Results 1 to 4 of 4

Thread: vlookup and if = #Value!

  1. #1
    Registered User
    Join Date
    06-29-2011
    Location
    New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question vlookup and if = #Value!

    I'm using multiple worksheets in one big spreadsheet to automatically work out job pricing. I need excel to look at the specified stock and decide which of two prices to use.

    Stock options are in worksheet B, and column A has either a 'y' or an 'n' as a filter. The prices are in worksheet C, using columns A/B and E/F respectively (first column is a quantity for vlookup to find, second column is the price).

    I need to get the formula to look at the stock, then if it's got a y, use the pricing in columns A/B. If it's got an 'n' I want it to use the pricing in E/F.

    This is what I'm trying to get working:

    =VLOOKUP($A$5,STOCK!$A$1:$B$26,(IF(STOCK!$A:$A,"y(VLOOKUP($B$4,COLOUR_A4!$A:$B,2,FALSE))","n(VLOOKUP ($B$4,COLOUR_A4!$E:$F,2,FALSE))")),FALSE)

    But it's just returning a #VALUE! error, and I can't figure out why. Any help would be appreciated - I've been staring at this for ages.

  2. #2
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,788

    Re: vlookup and if = #Value!

    =if(vlookup($a$5,stock!$a$1:$b$26,2,false)="y",vlookup($b$4,colour_a4!$a:$b,2,false),vlookup ($b$4,colour_a4!$e:$f,2,false))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    06-29-2011
    Location
    New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: vlookup and if = #Value!

    Thanks for that - it's returning a #N/A instead of a #VALUE!, but that's progress - will take another look later today.

  4. #4
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,788

    Re: vlookup and if = #Value!

    you'll only get n/a if no value found that matches what's in either a4 or b4
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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.2.0