Solved

Excel: Combine Columns Vertically

Posted on 2016-09-27
2
36 Views
Last Modified: 2016-09-27
Points of My Scenario
1. I have a spreadsheet with 2 (two) columns, A and B
2. I need to generate a column, C, that has alternating values/rows of columns A and B
Point of Clarification: If columns A and B each have 10 rows, then column C should have 20 rows

QUESTION: How do I accomplish this in Microsoft Excel?
0
Comment
Question by:waltforbes
2 Comments
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
ID: 41819023
You could use this formula in column C and copy down as required....

=IF(MOD(ROW(), 2)=1, INDEX(A:A, EVEN(ROW())/2), INDEX(B:B, EVEN(ROW())/2))

...or use this macro...

Sub AlternateRows()

    Dim rw As Long
    For rw = 1 To Cells(Rows.Count, "A").End(xlUp).Row
        With Cells(Rows.Count, "C").End(xlUp)
            .Offset(1, 0) = Cells(rw, "A")
            .Offset(2, 0) = Cells(rw, "B")
        End With
    Next
    
End Sub

Open in new window

0
 

Author Closing Comment

by:waltforbes
ID: 41819065
Hi Wayne Taylor, I tested the simpler function option and it worked like magic. I was so amazed.
What is your expertise/profession? What explains your knowledge of this esoteric area? (please, sir) :-)

I am so grateful. A thousand thanks!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now