+ Reply to Thread
Results 1 to 21 of 21

Multiple criteria lookups (INDEX + MATCH?)

  1. #1
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Multiple criteria lookups (INDEX + MATCH?)

    Hi

    I've read various articles on the web about how to use INDEX and MATCH to return a value using several criteria but I just cant seem to get mine to work! Driving me mad

    It would be a massive help to me if someone can help me sort this

    Ok, I have a list of Purchase order numbers and the quantities of item ordered on that particular order number

    On a seperate sheet I have a list of thousands of invoices that has the purchase order number, invoiced value and invoiced quantity.

    Now, as some of the purchase order numbers are used more than once (on both sheets) the only way I can match the invoice VALUE to the correct PO is by matching both the Purchase order number AND the quantity.

    So, I used the following forumula:

    {=INDEX(Sheet2!O1:O500000,MATCH(1,(Sheet2!B1:B500000=A2)*(Sheet2!C2:C500000=B2),0))}

    Explanation:
    Sheet 2 is the sheet with the invoice informaton on, O is the column in which the invoice values are (The value I wish to return)
    Column B in sheet 2 is where the purchase order number is
    Column C in sheet 2 is where the quantity is
    Cell A2 is the PO number I want to find a match for
    Cell B2 is the quantity I want to find a match for

    Matching both the PO number and PO quantity against the invoiced PO number and invoiced quantity will then tell me how much was invoiced against that particular PO

    Just keep getting a #REF or #NA error!

    Massive thank you to anyone who helps!

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Multiple criteria lookups (INDEX + MATCH?)

    {=INDEX(Sheet2!O3:O500000,MATCH(1,(Sheet2!B3:B500000=A2)*(Sheet2!C3:C500000=B2),0))}
    Try this
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Use SumifS()

    =SUMIFS(Sheet2!O1:O500000,Sheet2!B1:B500000,A2,Sheet2!C1:C500000,B2)


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Quote Originally Posted by nflsales View Post
    {=INDEX(Sheet2!O3:O500000,MATCH(1,(Sheet2!B3:B500000=A2)*(Sheet2!C3:C500000=B2),0))}
    Try this
    Still doesnt work

  5. #5
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Quote Originally Posted by :) Sixthsense :) View Post
    Use SumifS()

    =SUMIFS(Sheet2!O1:O500000,Sheet2!B1:B500000,A2,Sheet2!C1:C500000,B2)
    Cant use SUMIFS because some of the PO's are duplicated, and on the quantity may be exactly the same - so it adds together to values of both POs because the quantity and po is same.

    Thanks though!

  6. #6
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Quote Originally Posted by :) Sixthsense :) View Post
    Use SumifS()

    =SUMIFS(Sheet2!O1:O500000,Sheet2!B1:B500000,A2,Sheet2!C1:C500000,B2)
    Cant use SUMIFS because some of the PO's are duplicated, and on the quantity may be exactly the same - so it adds together to values of both POs because the quantity and po is same.

    Thanks though!

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Then nflsales suggestion should work for you.

    Please share a screenshot of the formula or attach a sample file

  8. #8
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Hi,
    try this
    {=INDEX(Sheet2!O3:O500000,MATCH(a2&B2,Sheet2!B3:B500000&Sheet2!C3:C500000,0))}

    Punnam

  9. #9
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Quote Originally Posted by :) Sixthsense :) View Post
    Then nflsales suggestion should work for you.

    Please share a screenshot of the formula or attach a sample file

    Apologies - this does work, but I'm getting #N/A when putting $ round the columns as I dont the fields to move when I drag the formula down

    How do I get around this?

    Thanks

  10. #10
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Re: Multiple criteria lookups (INDEX + MATCH?)

    So for example, this is actually the foruma copied from the sheet:

    =INDEX('INV data'!$O$5:$O$22434,MATCH(1,('INV data'!$C$4:$C$22434=E4)*('INV data'!$L$4:$L$22434=I4),0))

  11. #11
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Its worked using this formula:

    =INDEX('INV data'!$O$3:$O$22432,MATCH(1,('INV data'!$C$2:$C$22432=E4)*('INV data'!$L$2:$L$22432=I4),0))

    But it removes the { before and after when I drag the formula down?

  12. #12
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Re: Multiple criteria lookups (INDEX + MATCH?)

    And its worked a treat, thank you very much all. rep will be added

  13. #13
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Quote Originally Posted by exceldummy1990 View Post
    But it removes the { before and after when I drag the formula down?
    If you drag it then it won't get removed!

  14. #14
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Quote Originally Posted by :) Sixthsense :) View Post
    If you drag it then it won't get removed!
    I thought it had done it... Here is my formula:

    {=INDEX('INV data'!$O$3:$O$22432,MATCH(1,('INV data'!$C$2:$C$22432=E2859)*('INV data'!$L$2:$L$22432=I2859),0))}

    But its actually returning the value from 1 line BELOW of the matched critera? So lets say I want the value in O and the criteria is matched on line 50, its actually returning the value in O on line 51

  15. #15
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Because of wrong reference provided in index array part 'INV data'!$O$3:$O$22432.

    Adapt it to suit the other references like this 'INV data'!$O$2:$O$22432

  16. #16
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Quote Originally Posted by :) Sixthsense :) View Post
    Because of wrong reference provided in index array part 'INV data'!$O$3:$O$22432.

    Adapt it to suit the other references like this 'INV data'!$O$2:$O$22432
    Apologies, as soon as I asked the question I'd realised what I'd done wrong!

    If I wanted to put a 3rd criteria in, is that possible? Im trying to use the following formula but coming up for with NA:
    {=INDEX('INV data'!$O$1:$O$22431,MATCH(1,('INV data'!$C$1:$C$22431=E1)*('INV data'!$L$1:$L$22431=I1)*('INV data'!$E$1:$E$22431=C1),0))}

  17. #17
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Quote Originally Posted by exceldummy1990 View Post
    If I wanted to put a 3rd criteria in, is that possible? Im trying to use the following formula but coming up for with NA:
    Have you entered it as array formula?

    If so then there is not match found in that referred ranges

  18. #18
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Quote Originally Posted by :) Sixthsense :) View Post
    Have you entered it as array formula?

    If so then there is not match found in that referred ranges
    Yes I've entered as an array

    There is though, if I look manually for the PO number, I can see the qty and item description match, but its still coming back is N/A

    If my formula is right then it must be something else messing it up

  19. #19
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Quote Originally Posted by exceldummy1990 View Post
    If my formula is right then it must be something else messing it up
    Check whether the calculation process is interrupted Or it is completed fully.

    If the calculation is interrupted then you will see calculate message in the excel status bar.

    Or

    Check whether the cell possess any extra spaces which cannot be identified in the normal eye

  20. #20
    Registered User
    Join Date
    08-12-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    22

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Quote Originally Posted by :) Sixthsense :) View Post
    Check whether the calculation process is interrupted Or it is completed fully.

    If the calculation is interrupted then you will see calculate message in the excel status bar.

    Or

    Check whether the cell possess any extra spaces which cannot be identified in the normal eye
    Had a space in! Quick find and replace sorted that

    Thanks so much for your help!!!!

  21. #21
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Multiple criteria lookups (INDEX + MATCH?)

    Glad you fixed it and thanks for the feedback

+ 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] Index Match using multiple criteria to match to
    By sacastiglia in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-25-2014, 03:46 PM
  2. Index Match with Multiple Criteria
    By celestealexandra in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-04-2013, 08:35 PM
  3. Index Match formula for multiple lookups
    By RequestGuruHelp in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-04-2013, 10:51 PM
  4. INDEX and MATCH with range LOOKUPs?
    By neilbomb in forum Excel General
    Replies: 9
    Last Post: 06-22-2010, 07:33 PM
  5. Lookups Match Index??
    By myheadhurts in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-31-2008, 03:27 PM

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