+ Reply to Thread
Results 1 to 10 of 10

how to combine named arrays into a matrix

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Question how to combine named arrays into a matrix

    If I have vertical named arrays that are 5 rows each: array_1 and array_2 (not next to eachother in the worksheet), how do I combine them into a 5 row by 2 column named array?

    Thank you.
    Last edited by luv2glyd; 06-19-2010 at 01:41 PM.
    You either quit or become really good at it. There are no other choices.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: how to combine named arrays into a matrix

    what do you intend doing with it if you could?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to combine named arrays into a matrix

    To reference the two areas by one name, select both and enter a name in the Names box, left of the formula bar.

    For computational purposes, though, it will still not be a 5x2 range. You couldn't do matrix multiplication with it, for example. To do that would require some UDF that fleetingly combines them into a variant array.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: how to combine named arrays into a matrix

    Quote Originally Posted by martindwilson View Post
    what do you intend doing with it if you could?
    I was hoping to apply a VLOOKUP function to it, with the first named range being the first column of a "table_array" used by VLOOKUP.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to combine named arrays into a matrix

    Use INDEX/MATCH

  6. #6
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: how to combine named arrays into a matrix

    not sure how to do that.........

  7. #7
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: how to combine named arrays into a matrix

    post sample
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  8. #8
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: how to combine named arrays into a matrix

    I figured it out!

    =VLOOKUP(E11,(r_1:r_4),2,FALSE)

    (r_1:r_4) puts the two arrays side by side so that VLOOKUP can be applied to them as though they are in a table.

    looks like if I named my new array =r_1:r_4 (call it "total_array")

    =VLOOKUP(E11,total_array,2,FALSE) works as well
    Last edited by luv2glyd; 06-19-2010 at 01:51 PM.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to combine named arrays into a matrix

    If r_1 is the top cell in one range, and r_4 is the bottom cell in the other, I don't think that does what you're thinking.

    =INDEX(Array2, Match(E11, Array1, 0))

  10. #10
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: how to combine named arrays into a matrix

    Thank you - I'll keep your formula for future reference.

    r_1 is actually the first column (5 by 1 vertical vector) and r_2 is the second column (5 by 1 vertical vector). =r_1:r_2 seems to combine them into a 5 by 2 table, at least as far as VLOOKUP is concerned.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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