+ Reply to Thread
Results 1 to 4 of 4

Array formula: Automatically create a series of values for a one-dimensional matrix

  1. #1
    Registered User
    Join Date
    03-11-2014
    Location
    Stockholm
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Array formula: Automatically create a series of values for a one-dimensional matrix

    Hi,

    New to this forum, and I have a question that I haven't found any answer for yet.

    The question is only about optimizing Excel code, really.

    I have created an array formula with VLOOKUP that works fine. However, I have a string of consecutive values that I had to type myself (the values are used as column index for the VLOOKUP formula). See formula below:

    {=VLOOKUP(D2;'Database'!A:AL;_11_to_38;FALSE)}

    Where "_11_to_38" refers to the string:
    {11\12\13\14\15\16\17\18\19\20\21\22\23\24\25\26\27\28\29\30\31\32\33\34\35\36\37\38}

    As I said, the formula works fine. But my question is if this string could be created in a more optimized way?
    I have tried the functions ROW(11:38) and COLUMN(11:38). They produce values when used by themselves in a sheet, but don't work when used in the array formula above.

    Beware, I use a Swedish Excel, so some of the above functions and formulas could be misspelled or have syntax errors due to translation differences.

    Thanks in advance!

    /Andreas

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Array formula: Automatically create a series of values for a one-dimensional matrix

    try using
    Row(indirect("11:48") or transpose(Row(indirect("11:48"))
    to generate series inside an array formula
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Array formula: Automatically create a series of values for a one-dimensional matrix

    As you are trying VLOOKPUP (not HLOOKUP) the array shall be horizontal.
    Probably you were pretty close with COLUMNS(11:38) but it is not allowed formula. Try:

    Please Login or Register  to view this content.
    (11th column is K, while 38th AL)

    or move advanced with columns numbers (not letters):

    COLUMN(INDIRECT(ADDRESS(1,11)&":"&ADDRESS(1,38)))
    Best Regards,

    Kaper

  4. #4
    Registered User
    Join Date
    03-11-2014
    Location
    Stockholm
    MS-Off Ver
    Excel 2010
    Posts
    2

    Thumbs up Re: Array formula: Automatically create a series of values for a one-dimensional matrix

    Of course, columns are named by letters and not numbers, stupid of me

    Thank you, both suggestions works like a charm! And the transpose version makes it a little more simple to count manually

+ 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: 6
    Last Post: 09-25-2013, 10:08 PM
  2. Populate a Single Dimensional Array with two Dim Array (matrix)
    By Benjamin1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-03-2011, 12:49 PM
  3. How to Model Matrix (Two Dimensional Array)???
    By ryusukekenji in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-15-2009, 02:01 PM
  4. [SOLVED] permutation of values in 2 dimensional array
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2006, 03:40 PM
  5. [SOLVED] Create One-Dimensional Array from Two-Dimensional Array
    By Stratuser in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2005, 05:06 PM

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