+ Reply to Thread
Results 1 to 13 of 13

Index and Match function across multiple rows with repeating names

  1. #1
    Registered User
    Join Date
    06-04-2014
    Posts
    8

    Index and Match function across multiple rows with repeating names

    Hi,
    I have a data set where the row headings repeat a lot.
    I have 5 headers repeated probably 30-45 times each.
    Eg. Truck, Car, Van, Tank, House, Car
    At the moment I am using the formula...
    =INDEX($B$2:$M$45,MATCH($O$2,$A$2:$A$45,0),MATCH(O4,$B$1:$M$1,0))
    which will only return the result of the first occurrence of the cell it is looking for (for eg. I am looking for the values in the cells in columns labelled 'Car', is it possible for it to look past the first occurrence in the data set and find all the values?
    If you need more info just reply and I'll do my best to explain further.
    Thanks

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

    Re: Index and Match function across multiple rows with repeating names

    Try this Array Formula. Since this is an array formula so you need to confirm it with Ctrl+Shift+Enter instead of just Enter. (i.e. after placing the formula in the cell, hold down the Ctrl+Shift and then press Enter)

    Please Login or Register  to view this content.
    and then drag down until you get blank cells.
    Attached Files Attached Files
    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.

  3. #3
    Registered User
    Join Date
    06-04-2014
    Posts
    8

    Re: Index and Match function across multiple rows with repeating names

    Thanks so much, that is exactly what I need. Could I be a pain and ask you to manipulate the workbook so 'car,van,truck' is across the top and the months are down the side?
    Sorry; I am newish to Excel and still trying to get my head around formula manipulation.
    If you could do that it would be greatly appreciated!

  4. #4
    Registered User
    Join Date
    06-04-2014
    Posts
    8

    Re: Index and Match function across multiple rows with repeating names

    Below is the sheet I'm working on, if anyone could help out that would be great!
    Attached Files Attached Files

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

    Re: Index and Match function across multiple rows with repeating names

    See the attached sheet.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-04-2014
    Posts
    8

    Re: Index and Match function across multiple rows with repeating names

    Thanks for your help, just one final question.
    If I want to add more columns to the data set do I just have to extend the formaulas? I am doing so but it is not counting at all.
    Any more help would be greatly appreciated.
    Thanks

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

    Re: Index and Match function across multiple rows with repeating names

    If you are adding more columns, you need to match the range reference (in red) correctly according to your data for this formula to work correctly...

    =IFERROR(INDEX($B$2:$M$45,MATCH($O$2,$A$2:$A$45,0),SMALL(IF($B$1:$M$1=$O4,COLUMN($B$1:$M$1)-COLUMN($B$1)+1),COLUMNS($P4:P4))),"")

    where
    B2:M45 is the total data range.
    A2:A45 is the range containing Day nos.
    O2 is the cell where you have input the day lookup value.
    B1:M1 is the range containing vehicle types. you need to change it accordingly. Like if your last column is say AA1, the correct range will be B1:AA1
    O4 is the cell where the formula has lookup value for the vehicle type.
    In COLUMN($B$1:$M$1)-COLUMN($B$1), say if your last column is AA1, this will become COLUMN($B$1:$AA$1)-COLUMN($B$1)
    In COLUMNS($P4:P4), P4 is the first cell where you put this formula, So if you have more columns and you want to place this formula in say AD4, this part will become COLUMNS($AD4:AD4).

    Change all the ranges according to your actual data, and this formula will work.

    Hope this helps.

  8. #8
    Registered User
    Join Date
    06-04-2014
    Posts
    8

    Re: Index and Match function across multiple rows with repeating names

    Car van truck.xlsxThanks again, I am still having trouble with the formula. When I was trying to do it I was doing pretty much exactly what you said but wasn't having any luck!
    I'm starting to wonder whether it is because I am using a Mac?
    Below is the sheet I am working on; do you think you could extend the formula to say another 300 columns? I have quite a bit of data to add in!
    Thanks very much

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

    Re: Index and Match function across multiple rows with repeating names

    See the attached sheet.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    06-04-2014
    Posts
    8

    Re: Index and Match function across multiple rows with repeating names

    Thank you very much!
    This is greatly appreciated.

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Index and Match function across multiple rows with repeating names

    If you are interested:

    I would make this using VBA to get the data in an new sheet that can be used in a pivot table.

    After that I make an pivot table.

    Please reply if you are interested in that solution.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

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

    Re: Index and Match function across multiple rows with repeating names

    You're welcome. Thanks for the feedback.
    If that takes care of your original question, please mark your thread as solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.
    Moreover you may also click on * (star) to Add Reputation to those who have put their time and efforts to help you in this forum. This is another way to say thanks to them.

  13. #13
    Registered User
    Join Date
    06-04-2014
    Posts
    8

    Re: Index and Match function across multiple rows with repeating names

    Just one final thing, I am trying to convert this to another sheet as well. Which is the part of the formula that allows it to look passed the first occurrence of the event i.e "Car"
    Thanks

+ 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. Returning multiple distinct/repeating values for vlookup or index-match
    By amatvien in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-21-2018, 01:14 PM
  2. Index match function without array formula for multiple rows.
    By markb141 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-29-2014, 10:35 AM
  3. [SOLVED] How to index and match multiple criteria without repeating results?
    By PistachioPedro in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-20-2013, 05:38 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