+ Reply to Thread
Results 1 to 6 of 6

Merging two single column tables creating a new row for each pair

  1. #1
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Merging two single column tables creating a new row for each pair

    I have two tables. One has document numbers in a single column (doc1, doc2, doc3...). The other has one column of dates a year long (1/1/2016, 2/1/2016...until 12/1/2016). I need to merge the two tables so I get each document number repeated for each month in the other table. So merged together the first column has document numbers and the second column has dates. In the first column I would have doc1 repeated down and in the second column I would have the months all the way down until I ran out of months. Then Doc2 would start and be repeated as a new line for each of the months again.

    Right now I am doing this by hand but it is a lot of copying and pasting. Is there an easier way to do this?
    Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.

    <---Click * Add Reputation for all helpful comments. It's like giving a smile.
    Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Merging two single column tables creating a new row for each pair

    If you attach a sample file with your current layout and how you want it to appear (well, part of it), then I can give you some formulae to achieve this.

    To attach a file, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    Pete

  3. #3
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Merging two single column tables creating a new row for each pair

    Here is a file
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Merging two single column tables creating a new row for each pair

    You can put this formula in E2:

    =IF(ROWS($1:1)>(COUNTA(A:A)-1)*COUNT(C:C),"",INDEX($A$2:$A$11,INT((ROWS($1:1)-1)/COUNT(C:C))+1))

    and this one in F2:

    =IF(E2="","",INDEX($C$2:$C$13,MOD(ROWS($1:1)-1,COUNT(C:C))+1))

    then copy them down until you get blanks - in this case that will occur after row 121.

    Hope this helps.

    Pete

  5. #5
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Merging two single column tables creating a new row for each pair

    Thank you so much. I think that does what I need it to. I hadn't thought of comparing the two columns that way.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Merging two single column tables creating a new row for each pair

    You're welcome, Nigel - thanks for the rep.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Pete

+ 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: 2
    Last Post: 02-02-2012, 09:49 AM
  2. pair single column to multiple column
    By Ross in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 03:05 AM
  3. pair single column to multiple column
    By Ross in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 02:05 AM
  4. pair single column to multiple column
    By Ross in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 01:05 AM
  5. pair single column to multiple column
    By Ross in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 12:05 AM
  6. pair single column to multiple column
    By Ross in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-05-2005, 11:05 PM
  7. pair single column to multiple column
    By Ross in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-05-2005, 10:05 PM
  8. pair single column to multiple column
    By Ross in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-01-2005, 06:05 AM

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