+ Reply to Thread
Results 1 to 4 of 4

Vlookup inside an IF - Is this possible?

  1. #1
    Registered User
    Join Date
    05-22-2006
    Location
    Pickering, Ontario, Canada
    Posts
    22

    Arrow Vlookup inside an IF - Is this possible?

    Hi.

    I'm trying to nest a VLOOKUP inside an IF statement, but I'm having A LOT of trouble.


    Here's my function (which doesn't work):

    =IF((S5=12),0,VLOOKUP(T5,JennyTest,2))



    What I'm trying to do is the following:


    If S5=12, then input 0 in the cell, if not, then run the VLOOKUP.

    My result is I keep getting a "1".



    Does anyone know what I can do here?


    Thanks!

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Well, it's a totally viable formula, but I presume you don't expect 1 as an answer....

    Your VLOOKUP has no 4th argument. This means the lookup range, leftmost column of JennyTest, has to be sorted ascending. If you want an exact match only from VLOOKUP and your lookup range may not be sorted then use a 4th argument of zero, i.e.

    =IF(S5=12,0,VLOOKUP(T5,JennyTest,2,0))

  3. #3
    Registered User
    Join Date
    05-22-2006
    Location
    Pickering, Ontario, Canada
    Posts
    22
    Hi daddylonglegs and others....!!

    Unfortunately, that didn't work either........I still received a result of 1


    Eeek!

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Well, I suggest you need to break it down.

    What's in T5?

    What range does JennyTest represent?

    Where's the first occurence of T5 in the leftmost column of JennyTest.

    What value is in the corresponding cell in the next column?

    edit: or is S5 = 12?
    Last edited by daddylonglegs; 10-02-2006 at 06:53 PM.

+ 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