Merge Cells
Merge Cells functions are used to integrate multiple consecutive cells in either a row or a column. The cell range to merge may or may not contain the same content within it. (Note: Merge Cells is useful while exporting sheets)
Let us take a simple example. Following is the league standing table for EPL (English Premier League) 2011-12 season.
Let us first use export sheets command to export the ‘DATA’ sheet.
Case 1: Merge Cells In Columns
Merge Cells In Columns is used to merge cells within a specified column. Here, say we want to merge consecutive cells with same content in columns C, G, H, I, J.
We can see the function arguments from UI of Microsoft Excel (See Figure)
The 1st argument is the input column range. We will discuss 2nd argument which is optional later. After filling up the first argument (i.e in our case, Regiondown.sk(C2) and so on for columns G, H, I, J). We will add a dependency on export function so that we can make sure that first the format functions will run and then it would be exported in an excel, as follows:
We get the output as follows: (Note: Red outlined cells indicate the merged cells in column).
Case 2: Merge Cells In Rows
Merge Cells In Rows is used to merge cells within a specified row. Here, say we want to merge consecutive cells with same content in row 2 (Say, D2:F2). The function arguments from UI of Microsoft Excel are as same as in case of Columns with optional 2nd argument. After using the function, we need to fill down (in this case):
After running the activity we get the output as follows: (Note: Blue outlined cells indicate the merged cells in column).
Case 2: Merge Cells Using 2nd Argument is used when we want either a row or column to be merged using a specific criterion whether the cells in input range are identical or not. In above example 1st 3 teams get promoted to champions league, 4th team goes to qualification round for Champions league, 5th and 6th teams qualify for Europa League and bottom 3 teams relegate to inferior league. The format is shown (see figure)
We will fill in the arguments:
The regiondown input will not result in the desired output unless dependency is forced on export function as follows:
Final Output is shown in Green color: