+ Reply to Thread
Results 1 to 5 of 5

If Else - Vlookup

  1. #1
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    If Else - Vlookup

    Hello,

    I want to compare column A with column D. If the word in column A is the same as Column D OR , is the same as column D with 25 attached to it, to Display column E, or else display "-", if none of those conditions are met.

    so see attached example. what is formula i would put in column b?


    I thought it would be, =IF(A2,VLOOKUP(A2,$D$2:$E$6,1,FALSE),IF(A2&" 25",VLOOKUP($D$2:$E$6,1,FALSE),"-"))

    But thats not working..any help would be appreciated.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Hi VegasL,

    Try this formula:
    Please Login or Register  to view this content.
    I could have used MATCH in the first section as well, but a VLOOKUP works just as well (plus it shows you how either method could be implemented).

  3. #3
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293
    Thanks Paul, it works - appreciate it.

    It's so complex, I'm afraid I don't understand it.

    Is this the correct interpretation:

    IF(NOT(ISERROR(VLOOKUP(A2,$D$2:$E$6,1,0))) ..Lookup A2 on D2.E6 range, if an error exists (iserror), then don't display it (NOT), if there is no error, then perform function, VLOOKUP(A2,$D$2:$E$6,2,0)


    ELSE

    Perform Match Function and look up value A2&" 25", on range d2..e6, if there is a match then display data from range e2..e6

    is that right?

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    =IF(NOT(ISERROR(VLOOKUP(A2,$D$2:$E$6,1,0))),
    If VLOOKUP(A2,$D$2:$E$6,1,0) does not result in an error (a match is found), then

    VLOOKUP(A2,$D$2:$E$6,2,0),
    do the VLOOKUP and show that result; Else

    IF(NOT(ISERROR(MATCH(A2&" 25",$D$2:$D$6,0))),
    If MATCH(A2&" 25",$D$2:$D$6,0) does not result in an error (a match is found), then

    INDEX($E$2:$E$6,MATCH(A2&" 25",$D$2:$D$6,0))
    do an INDEX/MATCH to show that result (from column E); Else

    "-"))
    show "-".

  5. #5
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293
    Thanks For The Crystal Clear Explanation, It Helps Alot.

+ 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