+ Reply to Thread
Results 1 to 6 of 6

Vlookup If Statement

  1. #1
    Registered User
    Join Date
    06-28-2007
    Posts
    63

    Vlookup If Statement

    I am using a vlookup in an if statement. The formula is =IF(VLOOKUP(A19,U1:V8,2,0)=O19,"TRD",1). Basically, the formula says if the number in cell O19 is equal to a number found by the vlookup, return TRD, if not return 1.

    The formula works if O19 is actually a number. However, 019 references another cell in a differnt worksheet. The cell referenced is actually another formula.

    Is there a way to have excel recognize O19 as a number instead of a formula?

    Thanks.
    Link removed by Mod

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    if the result in O19 is a number, then it should still work... unless perhaps it is not a whole number and then we may have precision issues. Is that perhaps the case?
    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
    06-28-2007
    Posts
    63
    It is not a whole number, but the numbers are all simple, like .4, .3, etc, nothing over two decimals.

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

    =IF(VLOOKUP(A19,U1:V8,2,0)=TRUNC(O19,1),"TRD",1)

  5. #5
    Registered User
    Join Date
    06-28-2007
    Posts
    63
    That works well! Thanks for the help!

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Then that means, the result of the formula is not really only 1 decimal place...it may be formatted to appear so, but isn't actually.

+ 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