+ Reply to Thread
Results 1 to 18 of 18

Help with INDEX / MATCH

  1. #1
    Registered User
    Join Date
    06-19-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Help with INDEX / MATCH

    Hi All,

    I think I more or less understand INDEX / MATCH now.

    But instead of matching on 1 field, I would like to match on 2 fields.

    Basically, looking at the attached xlsx spreadsheet, I currently have A and B matching C (from the data sheet) and entering the correct values.

    As these are surnames, there are duplicates and it is currently only matching on the first surname and not the remainder.

    So I would like to match it against C and D - So only complete A and B if C and D matches.

    Then secondly, you will see I have made drop down list from the data on the data sheet (C and D) and D is populated (sort of) only with matching data from C. But this is not working correctly for duplicate surnames.

    If someone can please point me in the right direction or if someone can possibly assist me to get this sheet working correctly, I would really, really appreciate it.

    Thanks so much.

    Jakez
    Attached Files Attached Files

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Help with INDEX / MATCH

    Hello
    how about
    Enter Employee nr then from this the index/match will be populating the Cost center,surnames names and first name

    enter Employee Nr instead of using surnames...after all i think all employee nr do have duplicates...

    INDEX(DATA!$A$2:$D$50,MATCH(employee NR,DATA!$B$2:$B$35,FALSE),4)
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Help with INDEX / MATCH

    Does this help?
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-19-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Help with INDEX / MATCH

    Quote Originally Posted by vlady View Post
    Hello
    how about
    Enter Employee nr then from this the index/match will be populating the Cost center,surnames names and first name

    enter Employee Nr instead of using surnames...after all i think all employee nr do have duplicates...

    INDEX(DATA!$A$2:$D$50,MATCH(employee NR,DATA!$B$2:$B$35,FALSE),4)
    Thanks for the response.

    The problem is that the employee numbers are not easy to find in this case.

    The data on the data sheet is imported from a csv.

    And the data capturing is happing on sheet1 from hard copy registers, which are completed with date, name, surname, signature - so the employee number is not available on the source documents.

    This is the reason I would like to get the data capturer to enter the surname, then have the drop down with available people matching that surname and then based on the name selected, fills in the employee number and cost centre.

    Any ideas?

    I have been playing with what I found here: http://support.microsoft.com/kb/214142/EN-US

    But thusfar I am unable to get it to work correctly.

    I have tried this:

    =INDEX(DATA!$A$2:$D$50,MATCH($C2&$D2,DATA!$C$2:$C$35&DATA!$D$2:$D$35,0),2)

    But it just gives me a #VALUE! or #REF! as a result...

  5. #5
    Registered User
    Join Date
    06-19-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Help with INDEX / MATCH

    Quote Originally Posted by jakezp View Post
    =INDEX(DATA!$A$2:$D$50,MATCH($C2&$D2,DATA!$C$2:$C$35&DATA!$D$2:$D$35,0),2)
    This works if I enter the formula and then push CTRL+SHIFT+ENTER.... Weird....?!?!?!

  6. #6
    Registered User
    Join Date
    06-19-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Help with INDEX / MATCH

    Quote Originally Posted by dewilk View Post
    Does this help?
    Woooohooooo !!! It is perfect for the Cost Centre and Employee nr part.

    Now I just need to get the 2nd drop down (Name) work based on what you have sent me.

    I just need to decrypt your formula... haha...

    Do you have some quick advice on this part?


    Thanks so much!!!

  7. #7
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Help with INDEX / MATCH

    This part
    INDEX(DATA!$C$2:$C$35&DATA!$D$2:$D$35=$C2&$D2,)
    is taking two ranges from column C and D from Data sheet and by comparing with Surname and Firstname returning range of TRUE/FALSE statements
    then
    MATCH(TRUE,INDEX(DATA!$C$2:$C$35&DATA!$D$2:$D$35=$C2&$D2,),0))
    will find the position in the array
    then
    INDEX(DATA!A$2:A$35,MATCH(TRUE,INDEX(DATA!$C$2:$C$35&DATA!$D$2:$D$35=$C2&$D2,),0))

    Returns the corresponding cell from column A or B
    .
    The IFERROR function returns “" if there is no match.
    Use Evaluate Formula tool from Excel Option to see what's happening.

    Hope that helps.

    Please leave a feedaback if my solution helps you.
    (click the star on the left hand side of this post)
    Last edited by RobertMika; 06-19-2012 at 09:46 AM.

  8. #8
    Registered User
    Join Date
    06-19-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Help with INDEX / MATCH

    Quote Originally Posted by dewilk View Post
    This part
    INDEX(DATA!$C$2:$C$35&DATA!$D$2:$D$35=$C2&$D2,)
    is taking two ranges from column C and D from Data sheet and by comparing with Surname and Firstname returning range of TRUE/FALSE statements
    then
    MATCH(TRUE,INDEX(DATA!$C$2:$C$35&DATA!$D$2:$D$35=$C2&$D2,),0))
    will find the position in the array
    then
    INDEX(DATA!A$2:A$35,MATCH(TRUE,INDEX(DATA!$C$2:$C$35&DATA!$D$2:$D$35=$C2&$D2,),0))

    Returns the corresponding cell from column A or B
    .
    The IFERROR function returns “" if there is no match.
    Use Evaluate Formula tool from Excel Option to see what's happening.

    Hope that helps.
    Thanks for the explanation.

    I have entered the following in Name Manager as test:

    =INDEX(DATA!$A$2:$D$50,MATCH(Sheet1!$C5,DATA!$C$2:$C$35,TRUE),4)

    And then created a Data Validation List with Source: =test.

    This seems to almost work.

    If I have a non-duplicate surname, it populates D with the name. If I have a duplicate surname, it gives me a list with only 1 more option of a name.

    Can you please help with my formula, as I am goin nuts.

    As you can see, I dont really do Excel formulas on a regular basis and when I do, it's mostly little IF statements.

    Today was my first introduction to INDEX/MATCH.

    Thanks so much!

  9. #9
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Help with INDEX / MATCH

    Quote Originally Posted by jakezp View Post

    I think I more or less understand INDEX / MATCH now.
    Quote Originally Posted by jakezp View Post

    Today was my first introduction to INDEX/MATCH.

    which one is it?

    anyway, here is a similar approach, with dynamically extending ranges.
    Attached Files Attached Files
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  10. #10
    Registered User
    Join Date
    06-19-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Help with INDEX / MATCH

    Quote Originally Posted by icestationzbra View Post
    which one is it?

    anyway, here is a similar approach, with dynamically extending ranges.
    Hahaha...

    Well, today was my first introduction and I understand the basics, more or less, I think.

    But obviously I have a bit to go still...

    Thanks for the file, I will test and revert.

    Thanks

  11. #11
    Registered User
    Join Date
    06-19-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Help with INDEX / MATCH

    Quote Originally Posted by icestationzbra View Post
    which one is it?

    anyway, here is a similar approach, with dynamically extending ranges.
    I had a look, but it seems that it populates the First Name drop down with all data in the DATA Sheet D coulomb and not just where it is matching the Surname.

    My aim is to only populate the Full Name drop down with Names where the Surnames are the same.

    So in this spreadsheet, if the Surname selected is Johnson, only display Susan as a selectable name, but if the Surname is Peters, then display Dina, Donna and Lewis as a selectable option.

    Thanks again to everybody for the assistance.

  12. #12
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Help with INDEX / MATCH

    see attached - it has a caveat!
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    06-19-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Help with INDEX / MATCH

    Quote Originally Posted by icestationzbra View Post
    see attached - it has a caveat!
    Thanks so much!

    Busy driving home. I'll check it when I'm at home.

    Thanks again!

  14. #14
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Help with INDEX / MATCH

    See if this workbook does what you need.

    Enter Surname in C:C, and select a Name from the drop-down in D:D - Employee nr and Cost Center data will be populated.

    Note: Surmames must be grouped in your data table.
    Attached Files Attached Files
    Last edited by Marcol; 06-19-2012 at 11:56 AM. Reason: Explanation added
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  15. #15
    Registered User
    Join Date
    06-07-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010, Excel 2007
    Posts
    57

    Re: Help with INDEX / MATCH

    To add a point DATA is not defined

  16. #16
    Registered User
    Join Date
    06-19-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Help with INDEX / MATCH

    Thanks to everybody for the advice and examples and assistance.

    I really appreciate it.

    It is working very well. Exactly what I needed!

    Now I just need to get it build into my main spreadsheet.

    Cheers

  17. #17
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Help with INDEX / MATCH

    What is ....
    ... working very well. Exactly what I needed!
    ...

  18. #18
    Registered User
    Join Date
    06-19-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Help with INDEX / MATCH

    Quote Originally Posted by Marcol View Post
    What is .... ...
    The spreadsheet you sent me is working 100% and the one icestationzbra sent me is also working 100%.

    Pulling the correct data and populating the First Names drop down list correctly based on the Surname.

    Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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