+ Reply to Thread
Results 1 to 9 of 9

Pull sub array from array using multiple column_num values

  1. #1
    Registered User
    Join Date
    08-08-2013
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    20

    Pull sub array from array using multiple column_num values

    I have a table of data in Worksheet2 that spans from A1:H2024. In Worksheet1, I need to pull all data from the first three columns in the table in Worksheet1, so that I end up with A1:C2024. Is there an easy way to do this?

    The table in Worksheet2 has been saved as named range Table1.

    I've used the N(INDEX method before to use multiple row or column values in the INDEX function. So I tried this: =INDEX(Table1,0, N(INDEX({1,2,3},,))). This has worked before with other formulas. But in this case, I can't get it to work. For so,go reason it only pulls columns 1, 2, and 3 of just row 1, leaving me with the range A1:C1. Does anyone know what I'm doing wrong?

    I found a work around, by using this formula: =A1:INDEX(Table1, 2024, 3)), but it sleeps slightly less efficient and I was wondering if there's a better way. Thanks!

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

    Re: Pull sub array from array using multiple column_num values

    It is a sin Jin not adding the excel file, without confidential information.

    Please also add the expected result in your file, manualy.
    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.

  3. #3
    Registered User
    Join Date
    08-08-2013
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Pull sub array from array using multiple column_num values

    Yes, here is an example. I included a few examples of what I've tried so far, with no success, and at the end I included what my final goal should look like. Thanks!
    Attached Files Attached Files

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

    Re: Pull sub array from array using multiple column_num values

    So your goal is this result?

    Worksheet2!A2:Worksheet2!D10

    and what you are gonna do with that formula, since the data are available on sheet 2.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,768

    Re: Pull sub array from array using multiple column_num values

    It is not clear to me (and I suspect Oeldere too) exactly what are your expected results. Please complete a sample output sheet rather than just have comments such as "returns array of all rows in column 1".

  6. #6
    Registered User
    Join Date
    08-08-2013
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Pull sub array from array using multiple column_num values

    The end result is that I want to be able to specify a column number (4 in this case) and return a range of all rows, columns 1 thru 4. So A2:D10. In one of my example formulas, I specify all the columns I want to pull (1,2,3,4), and it pulls from all 4 columns, but just from row 1.

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

    Re: Pull sub array from array using multiple column_num values

    Reading your text and seeing your file: I think you ask for this one.

    With VLookup, see the green cells.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,768

    Re: Pull sub array from array using multiple column_num values

    Try this in B2 and copy across and down


    =IFERROR(INDEX(Worksheet2!$A$2:$D$10,,IF(COLUMN()-1<=$B$1,COLUMN()-1)),"")

  9. #9
    Registered User
    Join Date
    08-08-2013
    Location
    Cleveland, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Pull sub array from array using multiple column_num values

    My apologies for being vague. Here is a new example sheet that will explain things much better. My end outcome is to have one formula look at the string of text in column B, check if any of the values in Worksheet2 A2:D11 are in the string, and if they are, return the correct spelling (from Worksheet 2 A2:A11). I came up with a long formula that does this, but need something more elegant.

+ 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. [SOLVED] VBA: Pull unique text records from multiple columns and store into array?
    By kaptenstofil in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-24-2014, 10:39 AM
  2. [SOLVED] INDEX MATCH and MIN/SMALL to pull first and second smallest values from array
    By tlafferty in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-18-2014, 04:03 AM
  3. Create an array based off values in another array - exclude blanks
    By clifton1230 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-05-2013, 05:35 PM
  4. Replies: 19
    Last Post: 05-09-2012, 03:31 AM
  5. Pull row/column titles based on values inside an array
    By julzzzz in forum Excel General
    Replies: 1
    Last Post: 03-29-2012, 06:45 PM
  6. Find a value in an array and return multiple values in an adjacent array
    By tonbra in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2012, 08:35 PM
  7. Replies: 13
    Last Post: 11-25-2011, 04:57 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