+ Reply to Thread
Results 1 to 3 of 3

nested if statement using vlookup

  1. #1
    Registered User
    Join Date
    08-03-2010
    Location
    puckeridge,herts
    MS-Off Ver
    Excel 2003
    Posts
    43

    Red face nested if statement using vlookup

    Good Afternoon all

    I am having some trouble with a formula.

    On sheet 1, cell B3 contains a date, cell D3 contains the word "day", or "night", cell B5 contains the formula below:

    =IF(D3="DAY",VLOOKUP(B3,Sheet2!A5:C7,2,0),0)&IF(D3="NIGHT",VLOOKUP(B3,Sheet2!A5:C7,3,0),0)

    If D3 contains "Day", the answer ends with '0',
    If D3 contains "night" the answer starts with '0'

    I know why, it is because I have put & into the formula.

    Here is my problem, either I am using the incorrect functions to begin with, and if they are correct, I dont know how to nest them together correctly.

    Any advice will be great.

    Thanks

    mdot218
    Attached Files Attached Files
    Last edited by mdot218; 01-27-2012 at 02:42 PM.

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

    Re: nested if statement using vlookup

    Try:

    =IF(D3="DAY",VLOOKUP(B3,Sheet2!A5:C7,2,0),IF(D3="NIGHT",VLOOKUP(B3,Sheet2!A5:C7,3,0),0))
    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
    Registered User
    Join Date
    08-03-2010
    Location
    puckeridge,herts
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: nested if statement using vlookup

    thank you very much. glad to see I was on the right track at least.

+ 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