+ Reply to Thread
Results 1 to 10 of 10

dynamic index match formula to transpose values across rows and then down columns

  1. #1
    Registered User
    Join Date
    11-28-2013
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2013
    Posts
    21

    dynamic index match formula to transpose values across rows and then down columns

    Hello all. So I have a very tricky formula that I just can't seem to get; I'm a bit of a dabbler in excel and am afraid I just don't have what it takes to figure this one out.

    I've attached a file, & here's what I need it to do:
    Depending on which value (0-14, located in a2:a16) I input into k1, transpose the numbers from the matrix a1:g29 into K2:K34, reading across the rows, and then down from the last position in g. It's a bit confusing,so I tried to highlight the direction in which i want it to read, but column g will read down from different numbers. I put examples of what I would want 0 as the input to read like in L2, and what 1 as the input should read like in M2. I understand that the number of rows would be less for higher numbers input into k1, so I also have an iferror added in there. I've got the first cell formula correct in k2, but that's all I can get. If anyone can help it would be so appreciated! Thanks for looking!

    ~Laura
    Attached Files Attached Files

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: dynamic index match formula to transpose values across rows and then down columns

    Using your posted workbook, this regular formula, copied down, creates the list
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: dynamic index match formula to transpose values across rows and then down columns

    Put this formula in K2:

    =IFERROR(INDEX(A$2:F$16,$K$1+1,MATCH(ROWS($1:1),A$1:F$1,0)),IF(ROWS($1:1)-5+K$1>=29,"",INDEX(G:G,$K$1+ROWS($1:1)-4)))

    then copy it down to K34 at least.

    Hope this helps.

    Pete

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: dynamic index match formula to transpose values across rows and then down columns

    too late, deleted
    Ben Van Johnson

  5. #5
    Registered User
    Join Date
    11-28-2013
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: dynamic index match formula to transpose values across rows and then down columns

    Thanks both of you for your help! Both of the formulas worked, but Pete, I just copied and pasted yours & first. However, there is actually a larger table with values that I'm trying to apply this formula to, but I just can't seem to translate the formula to the right values. Is there any way you can explain to me what the -5, >=29, & -4 in reference to in the formula? It would be much appreciated. Thanks again!

    ~Laura

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: dynamic index match formula to transpose values across rows and then down columns

    The -5 is there because you have 5 columns of horizontal data before you want to get the data going down. The 29 is there because you are using 29 rows in column G. The -4 is there because you have 5 horizontal values and because you are using cell K1 for something other than the data to be returned (i.e. num_columns_used -1)

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    11-28-2013
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: dynamic index match formula to transpose values across rows and then down columns

    Hello again! So I definitely understood your explanation of those numbers; thank you for that. However, I am still having trouble translating it to this table I am working with. The formula is doing well reading the numbers down, but across is where the problem is coming from. I think it's because of the labels, but I'm not entirely sure. I really tried to figure this one out on my own, but I'm afraid I could spend twenty hours trying to with no solution. So, is there any way you can take a look at this and give me some hints as to what's going wrong?
    Last edited by Bananas212; 03-30-2014 at 03:45 PM.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: dynamic index match formula to transpose values across rows and then down columns

    This is the formula that you need in W3:

    =IFERROR(INDEX(A$3:P$73,$T$3+1,MATCH("Dur "&ROWS($1:1),A$2:P$2,0)),IF(ROWS($1:1)-15+T$3>=92,"",INDEX(Q:Q,$T$3+ROWS($1:1)-13)))

    Copy it down.

    Hope this helps.

    Pete

  9. #9
    Registered User
    Join Date
    11-28-2013
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: dynamic index match formula to transpose values across rows and then down columns

    Ah you are a life saver! So it was an issue with the match formula and the "dur"... that makes sense to me now, & the formula is making sense to me now also. When I first looked at it I had no idea what most of it meant, but you helped tremendously. Thank you so much!

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: dynamic index match formula to transpose values across rows and then down columns

    You're welcome - thanks for feeding back.

    Some of the numbers are different also, as you had an extra row at the top compared with your earlier example.

    Pete

+ 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. Sumproduct or index match dynamic formula
    By jw01 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-18-2013, 07:54 PM
  2. Replies: 6
    Last Post: 11-08-2013, 10:29 PM
  3. Increment columns in INDEX and MATCH formula - ROWS and COLUMNS
    By nickmangan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2012, 10:38 AM
  4. Manipulate dynamic rows values and dynamic columns values
    By excel_vb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2010, 09:22 PM
  5. dynamic range for index/match formula
    By excellicious in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-29-2008, 07:41 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