+ Reply to Thread
Results 1 to 6 of 6

IF statement with vlookup nested

Hybrid View

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question IF statement with vlookup nested

    Hi,

    I was hoping someone might be able to help me with a problem I've been having. I've attached a sample of the issue, as its work related i cant put the exact example but the principle is there.

    On the sample table E1:F5 I have threshold values for each code. In column A I have codes, in column B I have values of these codes. I need column C to say either "Check" or "ok" depending on if the value of the code from Column A goes over the threshold from the table E2:F5.

    I have tried to create a unique code to be greater then the unique code I've creating in column G

    =IF((A2&B2)>(VLOOKUP(A2,$E$2:$G$5,3,0)),"Check","ok")

    It appears that it is only picking up the first number on the lookup however because when the value goes beyond 2 digits it does not work correctly.

    If anyone has any ideas could they help us out.


    Thanks,


    Lib
    Attached Files Attached Files

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

    Re: IF statement with vlookup nested

    You mean?

    =IF(B2>VLOOKUP(A2,$E$2:$F$5,2,0),"check","ok")

    copied down
    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
    365
    Posts
    13,582

    Re: IF statement with vlookup nested

    Try this

    =IF(VLOOKUP(A2,$E$2:$F$5,2,FALSE)<=B2,"OK","Check")
    You don't need to combine columns as the item you are looking up is unique in the table.
    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 ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: IF statement with vlookup nested

    I don't understand where your problem is showing up exactly, because you're comparing two text strings together; I dunno how excel handles that but I don't think it's correct.

    Anyway my advice is get rid of the text string comparison and just compare numbers.

    C2 =IF(B2 > VLOOKUP(A2,$E$2:$F$5,2),"Check", "OK")
    And you can delete column G4.

    EDIT:
    "Great minds think alike", huh...?
    Last edited by ben_hensel; 08-16-2012 at 11:20 AM. Reason: got ninja'ed!?

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: IF statement with vlookup nested

    NBVC is the ultimate Excel Ninja.

  6. #6
    Registered User
    Join Date
    08-16-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: IF statement with vlookup nested

    Thanks for that!

    I was over complicating it with the combined columns I think, the idea was to make the combined value greater then the combined value on the lookup.

    Still learning some of these things.


    Thanks again,

    Lib

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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