Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
Solved

# Excel: Combine Columns Vertically

Posted on 2016-09-27
Medium Priority
134 Views
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
Question by:waltforbes

LVL 48

Accepted Solution

Wayne Taylor (webtubbs) earned 2000 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
``````
0

Author Closing Comment

ID: 41819065
Hi Wayne Taylor, I tested the simpler function option and it worked like magic. I was so amazed.

I am so grateful. A thousand thanks!
0

## Featured Post

Question has a verified solution.

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

MS Outlook undoubtedly is the most widely used email client.Its user-friendliness, cost effectiveness, and availability with Microsoft Office Suite make it the most popular email application.  Its compatibility with Microsoft applications like Exch…
In this article, I will demonstrate that how to do a PST migration from Exchange Server to Office 365. This method allows importing one single PST, or multiple PST's at once.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
###### Suggested Courses
Course of the Month14 days, 16 hours left to enroll