Merge rows by key
Location on ribbon: Tab DVD Addin → Group Cells and Rows → Menu Merge cells
Command ID: btnMergeRows
License required
This command needs a valid DVDAddin account (Standard or PRO). It is fully available during the trial period.
What it does
The command collapses all rows that share the same value in the first column (the key column) into a single row. In the remaining columns, numeric cells are added together as a formula such as =12.5+8.4+3 — keeping every term visible so quantities stay auditable — while text cells are concatenated on separate lines.
It suits detailed quantity take-offs that must be summarised per work code, or a material log with many deliveries per month that needs grouping by material name.
How to use
- Click DVD Addin → Cells and Rows → Merge rows by key.
- Excel's range picker appears with the prompt "Please select a range". Drag over the data block (exclude the header row) and click OK.
- The selection must be at least 2 columns × 2 rows; column 1 is always treated as the key column.
- The command reads the whole block, clears the selected range and writes the result back from the first row: one row per key, in first-appearance order.
- The status bar reports "Aggregated 40 rows into 12 groups".
Example
A concrete take-off measured per member, to be summarised per work code:
| Before | After | ||||
|---|---|---|---|---|---|
| Code | Quantity | Location | Code | Quantity | Location |
| AF.11110 | 12.5 | Footing M1 | AF.11110 | =12.5+8.4 → 20.9 | Footing M1 Footing M2 |
| AF.11110 | 8.4 | Footing M2 | AF.12220 | =6.2 → 6.2 | Column C1 |
| AF.12220 | 6.2 | Column C1 |
Notes
- The selected range is cleared and overwritten — Ctrl+Z cannot undo it, so back up the sheet or run the command on a copy of the block.
- Numeric cells become an addition formula (
=12.5+8.4); copy and Paste Special → Values if you need static numbers. - Text cells are joined with line breaks — turn Wrap Text on to see the full content.
- Rows left over below the collapsed result are blanked, not deleted; remove them manually if needed.
- Only column 1 can act as the key; move the key column to the front of the selection if it sits elsewhere.
- Holding ESC during the scan stops the command before the clear-and-write step, leaving the original data intact.
Related
- Merge similar — merges cells visually without aggregating numbers.
- Copy/Paste visible — transfers values between two tables using a key column.
- Auto group — rebuild the outline levels once the table is summarised.