• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Combine data

blcexcel

Member
I am looking for a quick method, formulas or VBA, to combine data from two lists. I copied a file for an example. The output needs to be a table with two columns; the first column List A and the second column List B. List B needs to be repeated for each item in List A. The total number of rows in the table would be 21,736.

Thanks in advance!
 

Attachments

  • Combine challenge.xlsx
    14 KB · Views: 8
Formula to write List A:
=INDEX(A:A,INT((ROW($A1)-1)/(COUNTA(B:B)-1))+2)

Formula to write List B:
=INDEX(B:B,MOD(ROW($A1)-1,COUNTA(B:B)-1)+2)

Note that I have the headers in row 1 for this to work. The red number is how many cells in the columns we don't want to count (e.g., the header cell). The blue number is what row our data actually starts in.
 
Back
Top