+ Reply to Thread
Results 1 to 6 of 6

VLOOKUP with condition

  1. #1
    Registered User
    Join Date
    01-23-2009
    Location
    Adelaide
    MS-Off Ver
    Excel 2016
    Posts
    31

    Question VLOOKUP with condition

    Hi All

    I am trying to do a vlookup, but only if it matches another condition, ie, not just bring back the first value it finds whilst descending. If you look at the example attached, I want to bring back a price against the item #, but only the price that also matched the customer. Hope this makes sense!

    Cheers
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: VLOOKUP with condition

    =SUMPRODUCT((Sheet2!$A$6:$A$12=A4)*(Sheet2!$B$6:$B$12=B4)*(Sheet2!$C$6:$C$12)) in sheet1 c4 dragged down
    note this would return
    36 for D5814 1AIRL30
    as
    there are 2 entries for
    D5814 1AIRL30
    14.00 &22.00
    is that what you want?

  3. #3
    Registered User
    Join Date
    01-23-2009
    Location
    Adelaide
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: VLOOKUP with condition

    Hi Martin

    This does work but there are instances when I want a value brought back without summing (due to the same lookup value, but with differing value range. Please see another example attached. In this I want to bring back a price for an item that has a different price depending on a price break. Can I bring back a specific price, if in another cell the value is greater than or equal to 10 but less than 20 for example. (The example explains it better).

    Cheers
    Attached Files Attached Files

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: VLOOKUP with condition

    =LOOKUP(B4,Sheet2!B4:B7,Sheet2!C4:C7)

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: VLOOKUP with condition

    Assuming this is as you say a multi conditional lookup (ie Col A on sheet2 is not always going to be d6998) then I would suggest you use:

    Please Login or Register  to view this content.
    The above does assume that that Price Break is listed in Ascending order by Item#

  6. #6
    Registered User
    Join Date
    01-23-2009
    Location
    Adelaide
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: VLOOKUP with condition

    Guys, you have done it again!! Thanks heaps

+ 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