+ Reply to Thread
Results 1 to 6 of 6

Create a list based on two sets of columns ... with a twist

  1. #1
    Registered User
    Join Date
    09-23-2015
    Location
    Dublin, Ireland
    MS-Off Ver
    2013
    Posts
    3

    Question Create a list based on two sets of columns ... with a twist

    Hi, I'm new here and I hope this query isn't too easy but I couldn't figure it out.

    I have 2 columns of data e.g.
    Column A
    1
    2
    3

    Column B
    textA
    textB
    textC
    textD
    textE

    What I need is to generate a list of 2 columns side by side like this
    1 | textA
    1 | textB
    1 | textC
    1 | textD
    1 | textE
    2 | textA
    2 | textB
    2 | textC
    2 | textD
    2 | textE
    3 | textA
    3 | textB
    3 | textC
    3 | textD
    3 | textE

    i.e. first cell based on Column A and second cell based on Column B, then value in B reiterates when value in A changes etc.

    Any help appreciated.

    Br, Kr

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Create a list based on two sets of columns ... with a twist

    Hi
    Try this
    =INDIRECT("A"&QUOTIENT(ROW(A1)-1,COUNTA($B:$B))+1)&INDIRECT("B"&IF(MOD(ROW(A1),COUNTA($B:$B))=0,10,MOD(ROW(A1),COUNTA($B:$B))))


    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Copy down
    Regards
    Last edited by José Augusto; 09-23-2015 at 10:46 AM.

  3. #3
    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
    28,306

    Re: Create a list based on two sets of columns ... with a twist

    Assuming data starts in row 1 of columns A and B

    In C1

    =INDIRECT("A"&(INT((ROW()-1)/COUNTA($B$1:$B$10))+1))

    in D1

    =INDIRECT("B"&(ROW()-INT((ROW()-1)/COUNTA($B$1:$B$10))*COUNTA($B$1:$B$10)))

    Adjust highlighted range in more than 10- entries

    Copy both formulas down
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-23-2015
    Location
    Dublin, Ireland
    MS-Off Ver
    2013
    Posts
    3

    Re: Create a list based on two sets of columns ... with a twist

    Thanks a million José ... this certainly could be built on for me.

  5. #5
    Registered User
    Join Date
    09-23-2015
    Location
    Dublin, Ireland
    MS-Off Ver
    2013
    Posts
    3

    Re: Create a list based on two sets of columns ... with a twist

    Hi John,

    You are a Legend! This is exactly what I needed. This is going to save me so much time going forward.

    Much respect and thanks.
    -Kr

  6. #6
    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
    28,306

    Re: Create a list based on two sets of columns ... with a twist

    Thanks for the feedback.

    If you are OK with the solution, could you please mark the thread as SOLVED ("Thread Tools" at top of first post).

+ 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. Create and index/list based on the values on 2 columns
    By Erik913 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-01-2014, 09:15 PM
  2. Replies: 7
    Last Post: 07-27-2013, 10:11 PM
  3. Want to Create a Dynamic List Excel based on a few columns in another sheet .
    By debsankardas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2013, 10:58 AM
  4. How to create drop down list in Excel where each list item is based on two columns?
    By matkiros in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2012, 08:50 AM
  5. Create list based on outcome of three columns
    By Arnifix in forum Excel General
    Replies: 3
    Last Post: 06-25-2010, 02:36 AM
  6. Create list based on outcome of three columns
    By Arnifix in forum Excel General
    Replies: 1
    Last Post: 06-24-2010, 02:38 AM
  7. Replies: 4
    Last Post: 09-04-2008, 09:51 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