Solved

Excel: Combine Columns Vertically

Posted on 2016-09-27
2
60 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

776 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