Microsoft Excel: For Each Cell In Column A, Have Three Rows In Column B

Article by Mr Excel (11,387 pts ) , published Aug 27, 2008

Problem: For each cell in column A, you want three rows in columns B and C, as shown in Fig. 1134. You also want to be able to perform calculations with the values in column C.

See all Microsoft Excel tips

Strategy: One common attempt is to use the Alt+Enter trick to enter three lines of data in column B. However, this will not work well in column C. Although the numbers are displayed fine, there is no way to have the numbers in C calculate automatically.

A better option is to merge cells A1:A3 into a single cell. You can then let the data in B fill B1:B3.

1) Select cells A1:A3. Choose Ctrl+1 to display Format Cells. On the Alignment tab, select Merge Cells, as shown in Fig. 1135.

Gotcha: Notice that the vertical alignment defaults to the bottom. This looks OK in a normal-height cell, but not so good in a triple-height cell.

2) Change the vertical alignment to top or center, as shown in Fig. 1136.

3) If you have several rows that need this formatting, copy the merged A1:A3 cell. Highlight A3:A6 and use Edit – Paste Special – Formats. Repeat for each section that needs a similar format. You will soon have a worksheet that appears to have three rows in column B for every entry in column A, as shown in Fig. 1137.

As shown in Fig. 1138, some creative use of the Borders setting around each group will help to further enhance the illusion of three rows for each value in column A.

Summary: To have three cells in column B, next to one cell in column A, use the Merge command on cells A1:A3.

Commands Discussed: Merge Cells

See all Microsoft Excel tips

Images

Fig. 1134Fig. 1135Fig. 1136Fig. 1137Fig.1138
 
Subscribe to Home Office
RSS
Get free weekly updates, directly to your inbox.