+ Reply to Thread
Results 1 to 10 of 10

Cascading table columns from multiple range sources

  1. #1
    Registered User
    Join Date
    01-05-2018
    Location
    Lexington, KY
    MS-Off Ver
    2007
    Posts
    28

    Cascading table columns from multiple range sources

    I'm trying to populate a table with data from 2 separate ranges that contain the same relative data, but for processing reasons must be in separate columns in a cascading fashion. Basically, one range populates the first column of the table, and the other populates the second. If there is a value in the first column, then the second column must be blank for that row, and if the second column has a value, the first column must also be blank. It is worth mentioning that the table has a number of blank rows at the end that are filtered out to give the table some dynamic functionality. Also, the values may contain duplicates within the first range, but will never have duplicates in the second, although there may be some values that match the first range. Finally, the table must retain the ability to be sorted and filtered.

    See the attached example for desired output.

    Thanks!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-05-2018
    Location
    Lexington, KY
    MS-Off Ver
    2007
    Posts
    28

    Re: Cascading table columns from multiple range sources

    I kind of feel like an INDIRECT is needed to "reset" the cell reference, but can't figure out how to increment the reference properly.

    This is what I've tried:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Cascading table columns from multiple range sources

    Two array formulae. In A2:
    =IFERROR(INDEX(H:H,SMALL(IF($H$2:$H$20<>"",ROW($H$2:$H$20)),ROWS(A$2:A2))),"")

    and in B2:
    =IFERROR(IF(A2<>"","",INDEX(K:K,SMALL(IF($K$2:$K$20<>"",ROW($K$2:$K$20)),ROWS(B$2:B2)-COUNTA($H$2:$H$20)))),"")

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    01-05-2018
    Location
    Lexington, KY
    MS-Off Ver
    2007
    Posts
    28

    Re: Cascading table columns from multiple range sources

    Glenn, thanks for the response. Your solution meets most of the conditions, however the table will no longer sort. Column 1 and 2 are static, and will not sort at all, while if I sort by column 3, the rows become misaligned. I added another column to reflect the edge case where some of the rows will be of the same type, so when sorted by that column, column 1 & 2 will look mixed up, so to speak.

    Thanks again for your help!
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Cascading table columns from multiple range sources

    I forgot about the sorting bit!!

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Cascading table columns from multiple range sources

    Try this:

    A2:
    =INDIRECT("H"&CELL("row",2:2))&""

    B2
    =IF(A2<>"","",INDIRECT("K"&CELL("row",2:2)-COUNTA($H$2:$H$20)))&""
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-05-2018
    Location
    Lexington, KY
    MS-Off Ver
    2007
    Posts
    28

    Re: Cascading table columns from multiple range sources

    Glenn, that doesn't seem to work either.

    Out of curiosity, why is the empty string add to the end of those formulas?

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Cascading table columns from multiple range sources

    OMG!! Time for a beer.... So, I'm stupid. Proved. But, here's one way, using a helper column.

    BtW, the &"" returns a blank when a formula, that normally returns text, returns a zero
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 02-09-2018 at 02:10 PM. Reason: adding a pair of commas for clarity!!!

  9. #9
    Registered User
    Join Date
    01-05-2018
    Location
    Lexington, KY
    MS-Off Ver
    2007
    Posts
    28

    Re: Cascading table columns from multiple range sources

    Perfect! Thanks so much for your help Glenn!

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Cascading table columns from multiple range sources

    You're welcome... and the beer is now going down nicely....

    G'nite Excel forum....

+ 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. VBA Pivot Table - Multiple Tables - Multiple Sources of Data
    By ryanmorris in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2012, 03:13 PM
  2. ListBox with multiple table sources
    By Marco-Kun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-27-2011, 07:08 AM
  3. Pivot Table Multiple Sources
    By billykiller05 in forum Excel General
    Replies: 1
    Last Post: 12-04-2008, 04:29 AM
  4. Single Pivot Table off Multiple Sources?
    By chasfh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-10-2007, 03:04 PM
  5. Pivot table - multiple sources
    By BC... in forum Excel General
    Replies: 3
    Last Post: 05-11-2006, 08:02 PM
  6. [SOLVED] pivot table - multiple excel sources
    By David in forum Excel General
    Replies: 0
    Last Post: 05-09-2006, 11:35 AM
  7. Multiple MS Access table sources for pivot table
    By fbj in forum Excel General
    Replies: 5
    Last Post: 08-15-2005, 11:05 AM

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