+ Reply to Thread
Results 1 to 15 of 15

Return value based on multiple criteria in Excel

Hybrid View

  1. #1
    Registered User
    Join Date
    03-24-2014
    Location
    Wiltshire, England
    MS-Off Ver
    Excel for Mac 2010
    Posts
    7

    Return value based on multiple criteria in Excel

    Hello,

    Please look at my attached file - you will notice two sheets, "Serial_Number" and "Item List.

    Serial_Number
    This sheet contains items on rows and account IDs on columns.
    Each item could potentially have 1 serial_number per account. I would like to display the serial numbers from the sheet "Item List" in the appropriate field in this sheet.

    Item List
    This sheet contains every single combination of item / account and includes the serial number.

    Can anyone help me with a formula to move the appropriate serial numbers into the first sheet?

    I have tried Vlookup but i can only base the results on one piece of criteria.

    I would really appreciate some help here
    Attached Files Attached Files

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Return value based on multiple criteria in Excel

    C2:

    =LOOKUP(2,1/('Item List'!$B$2:$B$3166=$B2)*('Item List'!$A$2:$A$3166=Serial_Number!$A2),'Item List'!$C$2:$C$3166)


    and copy down
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    03-24-2014
    Location
    Wiltshire, England
    MS-Off Ver
    Excel for Mac 2010
    Posts
    7

    Re: Return value based on multiple criteria in Excel

    Hi,

    Thanks for that!
    It works great for column C, but when i copy to the right i can't do the same for every account number.
    Any ideas?

    Many thanks in advance!

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Return value based on multiple criteria in Excel

    Oops.


    Try this, then copy down and over.

    =LOOKUP(2,1/('Item List'!$B$2:$B$3166=$B2)*('Item List'!$A$2:$A$3166=C$1),'Item List'!$C$2:$C$3166)

  5. #5
    Registered User
    Join Date
    03-24-2014
    Location
    Wiltshire, England
    MS-Off Ver
    Excel for Mac 2010
    Posts
    7

    Re: Return value based on multiple criteria in Excel

    Thanks Again,

    Unfortunately this isn't really what i'm after.
    If you like at the sheet "Item List" and search for all rows with an "account_ID" of "1000091" you will find just 1 row.
    This would mean that the sheet "Serial_number" will only have 1 serial_number (FMD0072056) in column C row 35.

    I hope this helps!

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Return value based on multiple criteria in Excel

    Oh my god I missed a parenthesis.

    C2:

    =IFERROR(LOOKUP(2,1/ ( ('Item List'!$B$2:$B$3166=$B2)*('Item List'!$A$2:$A$3166=Serial_Number!C$1) ) ,'Item List'!$C$2:$C$3166),"")


    I need my tea..
    Last edited by daffodil11; 03-24-2014 at 10:58 AM. Reason: AND A DOLLAR SIGN. SERIOUSLY.

  7. #7
    Registered User
    Join Date
    03-24-2014
    Location
    Wiltshire, England
    MS-Off Ver
    Excel for Mac 2010
    Posts
    7

    Re: Return value based on multiple criteria in Excel

    Haha well you are doing a better job than me (and i have a full stomach!),

    This does successfully leave the field blank but unfortunately doesn't give me any values?

  8. #8
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Return value based on multiple criteria in Excel

    Then what is the second criteria? There are no tems that match both account and name.

    Do you want to leave them blank if not found?

  9. #9
    Registered User
    Join Date
    03-24-2014
    Location
    Wiltshire, England
    MS-Off Ver
    Excel for Mac 2010
    Posts
    7

    Re: Return value based on multiple criteria in Excel

    So C2 for example must match "Item List" Name with B2 and "Item List" Account ID with C1.

    If there is no match the field must remain blank.

  10. #10
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Return value based on multiple criteria in Excel

    Yes, to get blanks you have to code for it. The working formula from my previous post:

    =IFERROR(LOOKUP(2,1/ ( ('Item List'!$B$2:$B$3166=$B2)*('Item List'!$A$2:$A$3166=Serial_Number!C$1) ) ,'Item List'!$C$2:$C$3166),"")

  11. #11
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Return value based on multiple criteria in Excel

    It only puts values where the account occurs.

  12. #12
    Registered User
    Join Date
    03-24-2014
    Location
    Wiltshire, England
    MS-Off Ver
    Excel for Mac 2010
    Posts
    7

    Re: Return value based on multiple criteria in Excel

    I understand.

    But i should have serial_number - FMD0072056 in column C row 35. But there is nothing.

  13. #13
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Return value based on multiple criteria in Excel

    Visuals are always helpful.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    03-24-2014
    Location
    Wiltshire, England
    MS-Off Ver
    Excel for Mac 2010
    Posts
    7

    Re: Return value based on multiple criteria in Excel

    I have no idea what i managed to do, but i copied the formula from your file directly into mine and it works!
    You are a genius!!

    Thank you so much, saved me hours and hours of boring work.

  15. #15
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Return value based on multiple criteria in Excel

    Lazy is the mother of process improvement. There's always a better way!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to return multiple values to a single cell based on multiple criteria
    By lwallace in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-20-2014, 06:32 AM
  2. Replies: 2
    Last Post: 03-03-2014, 10:03 PM
  3. Excel 2007 : Return Value Based on Multiple Criteria
    By pmhxcel in forum Excel General
    Replies: 12
    Last Post: 04-20-2011, 10:13 AM
  4. [SOLVED] Return a value based on multiple criteria
    By jacarutu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-18-2010, 05:52 PM
  5. Count Multiple Entries, Return Multiple Rows, Based On 3 Criteria
    By gtj_global in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-20-2008, 06:40 PM

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