+ Reply to Thread
Results 1 to 28 of 28

Matrix Building using VLOOKUP, INDEX and MATCH

  1. #1
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Matrix Building using VLOOKUP, INDEX and MATCH

    Hi,

    I'm trying to generate a matrix kind of structure which I want to use for display in a dashboard the input for this dashboard is taken from an automated report taken from an external system.

    I could not post the original data, so I've tried to provide a mocked up data sheet, which I've enclosed in this thread.

    The data taken from an external system is of a specific format in a specified order. I've mocked it in the Source sheet. I'm trying to build a matrix with different combinations subject-wise (A, B, C, and so on etc.) and use it in the output sheet, using VLOOKUP, INDEX and MATCH combination. But I'm getting baffled while building the matrix due to the different combinations.

    Can someone help me build the matrix and help me with the coding the VLOOKUP, INDEX and MATCH formulas in my output sheet as well?

    Do let me know if you need any further information.
    Last edited by Saarang84; 05-23-2014 at 01:19 AM. Reason: Reposted sample workbook in post #9, hence removing it in my initial post
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  2. #2
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Here's some additional information :

    The data from the external system comes out in different sheets each time (I've copied and pasted it into the Source worksheet). This source consists of Users (User1, User2, User3, etc.), Subjects (A, B, C, etc.), Scores (Combo1, Combo2, Combo3, etc.) and their corresponding Grades (Combo1A, Combo2A, Combo3A, etc.). This data is for different terms (5 in total) and each collection would have scores and grades pertaining to all users for all subjects pertaining to a particular term. There are n users and x subjects in total.

    I'm looking at having multiple types of outputs :

    a. User-wise listing of scores & grades for all terms subject-wise (layout as in Output sheet)
    b. Subject-wise grades and scores for all users (layout as in Matrix sheet)
    Last edited by Saarang84; 05-22-2014 at 07:28 AM.

  3. #3
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Bumping due to no response..

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Sorry, can you explain a bit clearer?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  5. #5
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Which part you want me to explain again? Did you have a look at the attachment? I've mocked it with random numbers and alphabets, but in my actual data there will be scores in place of the numbers and grades in place of alphabets.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    So in Output, shouldn't Combo1 User 1 "A" be 4 not 2 (from source B3)?

    Also, when a column doesn't have a letter, as in the first source table column G, does that mean it's the same as the letter in the previous column (i.e D)?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  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: Matrix Building using VLOOKUP, INDEX and MATCH

    It can be achieved easily if you restructure your data

    Instead of keeping the data as each regions/areas keep the data in running format by allocating column headers in the top only


    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

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Agreed on both points from ChemistB and SixthSense: the output is not clear and the data layout leaves a lot to be desired.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  9. #9
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    I've remodelled the Source sheet and updated it with comments. As I said earlier, I need two types of Output - Subject-wise and User-wise.
    Attached Files Attached Files
    Last edited by Saarang84; 05-22-2014 at 10:31 AM.

  10. #10
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Quote Originally Posted by ChemistB View Post
    So in Output, shouldn't Combo1 User 1 "A" be 4 not 2 (from source B3)?
    Have you noticed that he is using Randbetween to populate the sample values, so every time the sheet is opened, the values are recalculated.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  11. #11
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    I'm not worried about the random values populated as this is just sample data. I only need to get the scores and grades in the cells in my output tables, say by using VLOOKUP with and / or INDEX and MATCH functions.

    Kindly have a look at my remodelled worksheet in my post #9.
    Last edited by Saarang84; 05-22-2014 at 10:51 AM.

  12. #12
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    In reality, will the headers actually be Combo1, Combo2, etc or will they just be Score and Grade, with the only identification being which table they come from?

  13. #13
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Quote Originally Posted by ChemistB View Post
    In reality, will the headers actually be Combo1, Combo2, etc or will they just be Score and Grade, with the only identification being which table they come from?
    As mentioned in post #2, in the Source sheet, Combo1 would be score1 for all subjects (A, B, C, etc.) and grade for all Key stage results relevant to the first term (the first table), similarly in the second table, it will be Combo2 would be score2 and grade for all Key stage results for all subjects pertaining to 2nd term, and so on. Likewise, there will be 5 tables for a full year extracted into 5 different sheets, each pertaining to a particular term. This data is an extract of the MIS report executed and exported from an external system from time to time.

    Actually, in my original data sheet, Combo1, Combo2, etc. are called Pred1, Pred2, etc. (predictive scores) and grade is called KSR (Key Stage results). The data for the Source sheet that I've uploaded here contains data till the completed term.

    Enclosed herewith is the screenshot of the actually extract. I've mocked out the names, but retained the subject titles. There will be x number of users and y subjects.

    I find it difficult to locate and fill in the predictive grades and Key stage results in the output formats that I need i.e. subject-wise and user-wise.

    Definitions :
    Pred1, Pred2, Pred3 etc are the Predicted grades for each Student in that particular year and the 1, 2, 3 refers to the term - These WOULD change as each term progresses as the students SHOULD improve as the year goes on.

    KS is the Key Stage results for each Learner - These will be the same every term (By saying same, I do not mean the values or results, but its an indicator whether the student has Passed or Failed.
    Attached Images Attached Images

  14. #14
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Try this to see if you get the desired output.
    On Output Matrix sheet......

    In B3
    Please Login or Register  to view this content.
    and then drag across and down.

    In B15
    Please Login or Register  to view this content.
    and then drag across and down.
    Attached Files Attached Files

  15. #15
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Hi sktneer,

    Your solution is working fine in my model workbook, however, when I try to convert them to my original data, its giving me errors.
    Refer attached workbook.
    Attached Files Attached Files
    Last edited by Saarang84; 05-23-2014 at 04:15 AM.

  16. #16
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    If the formula is working fine with the workbook you attached, you only need to make sure that the formula is referencing the correct range in your original workbook.
    Evaluate the formula to see if the correct range is being referenced or not?

  17. #17
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    I've checked it and its not working, please refer the attachment in my post #15.

  18. #18
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Perhaps you should add some of your manually-calculated desired results to this version of the file.

    Regards

  19. #19
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Enclosed the sheet which contains the expected output from my input data. The main problem I face is that there are merged cells in my source sheet while trying to incorporate the solution given by sktneer.
    Attached Files Attached Files
    Last edited by Saarang84; 05-23-2014 at 06:53 AM. Reason: Adding attachment

  20. #20
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    There's only one tab in there (?)

    Regards

  21. #21
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Quote Originally Posted by XOR LX View Post
    There's only one tab in there (?)

    Regards
    That's the output I want to generate for my input workbook available in my post #15.

  22. #22
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Ah, with separate workbooks we won't have easy resource to e.g. 3D referencing across tabs (which may well form part of the solution, unless you think otherwise), so I feel that this may be something I can't help you with.

    All the best and regards.

  23. #23
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Quote Originally Posted by XOR LX View Post
    Ah, with separate workbooks we won't have easy resource to e.g. 3D referencing across tabs (which may well form part of the solution, unless you think otherwise), so I feel that this may be something I can't help you with.

    All the best and regards.
    Apologies XOR, I've enclosed the workbook which I'm working with. I want to incorporate the formulas in the Summary sheet to get my results as in the Expected_Output worksheet. Can u help me?
    Attached Files Attached Files

  24. #24
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Sorry - it's too poor a set-up. You have merged cells in all your headers and, worse, some of the subjects span two merged cells whilst others, e.g. Btec Sport apply to only a single column.

    Excel can do wonderful things. But that's no reason to say we shouldn't always first make sure that our layout and structure are designed in the best possible manner so as to facilitate analysis/reporting, etc., not to mention the formula work.

    In short, I think you need to have a re-think about the design of your workbook.

    Regards

  25. #25
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Quote Originally Posted by XOR LX View Post
    Sorry - it's too poor a set-up. You have merged cells in all your headers and, worse, some of the subjects span two merged cells whilst others, e.g. Btec Sport apply to only a single column.

    In short, I think you need to have a re-think about the design of your workbook.

    Regards
    Thanks for the clarifications. I received these extracts from an external system from support team. I'll ask them to provide me the data with correct format. I'm marking this thread as solved and will start a fresh one.

  26. #26
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Find the attached sheet to see if this works as per your need.
    Attached Files Attached Files

  27. #27
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    Thanks sktneer.. I'll check out the formula to understand how it works and will let you know if I have any questions.
    Its exactly what I need, but if the cells are blank in the source sheets, I would need it be blank in the Output sheet as well. Currently, it reflects as zero.

  28. #28
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Matrix Building using VLOOKUP, INDEX and MATCH

    See the attached sheet.
    Attached Files Attached Files

+ 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. Replies: 11
    Last Post: 03-26-2014, 12:48 AM
  2. Replies: 2
    Last Post: 02-12-2014, 01:12 PM
  3. Building upon an INDEX and MATCH search with expanded criteria.
    By parky58 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-20-2012, 03:17 AM
  4. Help Match Index Formula for a table matrix
    By prkhan56 in forum Excel General
    Replies: 2
    Last Post: 09-29-2011, 04:40 AM
  5. Building a matrix
    By systemx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-18-2006, 09:12 AM

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