+ Reply to Thread
Results 1 to 3 of 3

Excel Lookup with If

  1. #1
    Registered User
    Join Date
    08-26-2004
    Posts
    4

    Excel Lookup with If

    Hello,

    I have a table that I do lookups on in a worksheet that seems to not work as I expected.

    I added another column of source table data that I want to use to do a conditional check, i.e. if value in cell = Y then proceed and read the table data and do a calculation.

    I can't seem to get the check to work. I tried to make it an "AND" so that two conditions would have to be met, but that didn't work.

    Here's my formula, before and after I added the additional column of data and check.

    Before:
    =IF(D53="Synch",(VLOOKUP(B53,PublisherTable!$A:$V,4,FALSE)),IF(D53="Print",(VLOOKUP(B53,PublisherTable!$A:$V,13,FALSE)),IF(D53="Mech",(VLOOKUP(B53,PublisherTable!$A:$V,10,FALSE)),IF(D53="Perf",(VLOOKUP(B53,PublisherTable!$A:$V,7,FALSE)),IF(D53="Master",(VLOOKUP(B53,PublisherTable!$A:$V,7,FALSE)),IF(D53="Services",0%,0%))))))

    After:
    =IF(D59="Synch" & K59="NO",(VLOOKUP(B59,PublisherTable!$A:$V,4,FALSE)),IF(D59="Print"& K59="NO",(VLOOKUP(B59,PublisherTable!$A:$V,13,FALSE)),IF(D59="Mech"& K59="NO",(VLOOKUP(B59,PublisherTable!$A:$V,10,FALSE)),IF(D59="Perf"& K59="NO",(VLOOKUP(B59,PublisherTable!$A:$V,7,FALSE)),IF(D59="Master"& K59="NO",(VLOOKUP(B59,PublisherTable!$A:$V,7,FALSE)),IF(D59="Services"& K59="NO",0%,0%))))))

    The after does not appear to work, if I change the NO to YES, and there is a match, it doesn't work.

    Any help appreciated.

    Thanks,
    Victor

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451
    Your use of AND is incorrect

    Change your conditional check to: =IF(AND(D59="Synch",K59="No"),now your VLOOKUP,etc,etc

    You also have unnecessary brackets enclosing your VLOOKUPS

    Instead of (VLOOKUP(blah,blah,blah))

    Use VLOOKUP(blah,blah,blah)
    Last edited by Cutter; 08-29-2005 at 05:06 PM.

  3. #3
    Registered User
    Join Date
    09-16-2003
    Location
    Waiau Pa NZ
    Posts
    81
    Have another go using the if and formula

    =IF(AND(D59="Synch",K59="NO"),VLOOKUP(B59,PublisherTable!$A:$V,4,FALSE),IF(AND(D59="Print",K59="No"),VLOOKUP(B59,PublisherTable!$A:$V,13,FALSE),IF......

    Take care where you put the () brackets
    Greetings from New Zealand
    Bill Kuunders

+ 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