+ Reply to Thread
Results 1 to 9 of 9

Multiple if and vlookup

Hybrid View

  1. #1
    Registered User
    Join Date
    07-15-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    43

    Multiple if and vlookup

    In my worksheet I am trying to enter a formula so that I can auto load cell E20
    If B20 cell is not blank
    IF value of cell F9 = “R” use vlookup to retrieve value from column 3 of ‘Price list’ work sheet
    But If value of cell F9 = “W” use vlookup to retrieve value from column 5 of ‘Price list’ work sheet
    I have tried the following formula but don’t think it is correct for what I need..
    =IF(B20>" ",(=IF(F9="R",(VLOOKUP(B20,RetailPrice,3,FALSE))," ") =IF(F9="W",(VLOOKUP(B20,RetailPrice,5,FALSE))" ")
    Can someone suggest a solution or help fix the syntax of the formula?

  2. #2
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Multiple if and vlookup

    =if(b20>0,if(f9="r",(vlookup(b20,a:z,3,0)),if(f9="w",(vlookup(b20,a:z,5,0)," "))
    unable to download your workbook,,,so on suggess sending this plz try

  3. #3
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Multiple if and vlookup

    =if(b20>0,if(f9="r",(vlookup(b20,a:z,3,0),if(f9="w",(vlookup(b20,a:z,5,0)," "))

  4. #4
    Forum Contributor
    Join Date
    10-01-2013
    Location
    Cameron, Mo
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Multiple if and vlookup

    I would have gone this way
    Attached Files Attached Files

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Multiple if and vlookup

    This should solve your problem:

    Formula: copy to clipboard
    =IF(AND(B20<>"",$F$9="R"),VLOOKUP(B20,'Price list'!$B$5:$F$52,3,0),IF(AND(B20<>"",$F$9="W"),VLOOKUP(B20,'Price list'!$B$5:$F$52,5,0),""))
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  6. #6
    Registered User
    Join Date
    07-15-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Multiple if and vlookup

    This appears to work when selecting a populated product from the from box. But returns #NA in the Unit Price (column E) if there is no product selected to load the Unit Price field.

  7. #7
    Registered User
    Join Date
    07-15-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Multiple if and vlookup

    Thank you newdoverman. Your suggested formula appears to have done the trick. It will take me a while to learn exactly how it does what it does. I appreciate all of the help and suggestions from those who have replied to this thread. Many thanks.

  8. #8
    Forum Contributor
    Join Date
    10-01-2013
    Location
    Cameron, Mo
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Multiple if and vlookup

    Sorry, didn't account for that. This one correct that.
    Attached Files Attached Files

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Multiple if and vlookup

    Thank you for the feedback.

    This formula breaks the problem into two parts each of which satisfy 2 conditions that being B20 not blank and if F9 is an R or W. The AND functions says that everything between the () must be true for the formula to return the TRUE argument otherwise the FALSE part kicks in. If neither is satisfied, "" is the result.

+ 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. Vlookup (or index/match) with multiple criteria over multiple sheets
    By Groovicles in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-18-2013, 01:56 PM
  2. Vlookup function to return multiple values from multiple sheets
    By bsamant in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-13-2013, 11:31 AM
  3. Replies: 3
    Last Post: 07-25-2013, 08:25 AM
  4. vlookup? match? index? MULTIPLE criteria for vlookup search problem....
    By aborg88 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-11-2013, 09:56 AM
  5. Multiple Row Match (VLOOKUP Extended) to find Multiple Rows
    By Niper in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2011, 10:58 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