+ Reply to Thread
Results 1 to 4 of 4

Nesting VLOOKUP in an IF statement.

  1. #1
    Registered User
    Join Date
    01-18-2010
    Location
    Santa Rosa Beach, FL
    MS-Off Ver
    Excel 2003
    Posts
    1

    Nesting VLOOKUP in an IF statement.

    I am trying to write a formula that uses both an if statement and a vlookup statement.

    It's for a house cleaning price list, with two sets of prices. I want the formula to say if the value in E7 is R, i want to lookup the value for the house in the second column. If the value in the cell is anything else, i want to lookup the value for the house in the third column.

    So in sense, my formula should look like =IF (E7=1,"=VLOOKUP(A10,'Clean Prices'!$A$2:$C$58,2,FALSE)","=VLOOKUP(A10,'Clean Prices'!$A$2:$C$58,3,FALSE)")

    But it doesn't work. Is it possible to nest a vlookup in an if statement?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,905

    Re: Nesting VLOOKUP in an IF statement.

    Should be:

    =IF (E7=1,VLOOKUP(A10,'Clean Prices'!$A$2:$C$58,2,FALSE),VLOOKUP(A10,'Clean Prices'!$A$2:$C$58,3,FALSE))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    MS 2007, 2010
    Posts
    12,202

    Re: Nesting VLOOKUP in an IF statement.

    You don't need the quotes or the equal signs for your VLOOKUPS.
    Please Login or Register  to view this content.
    Does that work for you?
    ChemistB
    My 2

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,188

    Re: Nesting VLOOKUP in an IF statement.

    Or =VLOOKUP(A10,'Clean Prices'!$A$2:$C$58,IF(E7="R",2,3),FALSE)

+ 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.6.0 RC 1