Skip to main content

Merge Rows in Excel in Make

What this module does

PDF4me Excel — Merge Rows consolidates duplicate rows in an Excel worksheet by grouping on one or more key columns. Rows that share the same key column values are merged into a single row — values from all other columns are combined into one cell using a semicolon separator, with identical values automatically removed. Use it to consolidate customer orders by ID, deduplicate data exports, or roll up product data to category level — all without writing a single formula or opening Excel.

Authenticating Your API Request

Every PDF4me module in Make requires a valid Connection. Create or select one that holds your PDF4me API key so the scenario can authenticate row merging requests securely.

Important Facts You Should Not Miss

Key columns control what gets grouped
Enter the 1-based column numbers that identify a unique record as a comma-separated string in MergeKey Columns — for example "1" to group by CustomerID in column A, or "1,2" to group by CustomerID and Region together. Rows sharing the same values in all key columns are merged into one. All other columns have their values joined with "; " and duplicate values removed.
Empty MergeKey Columns removes exact duplicates only
Leave MergeKey Columns blank and every column becomes part of the key. Only rows where every single cell is identical are collapsed — the first occurrence is kept and all subsequent exact duplicates are removed. This is the fastest way to clean a data export that contains fully repeated rows.
All indexing is 1-based
Both Worksheet Numbers and MergeKey Columns use 1-based indexing — worksheet 1 is the first tab, column 1 is column A, column 2 is column B. Enter values as comma-separated strings: "1,2,3" for worksheets or "1,3" for key columns. At least one worksheet number must be provided.
Make PDF4me Excel Merge Rows module showing File Name and Document fields mapped from step 1, Worksheet Numbers set to 1, MergeKey Columns set to 6, and Output Format set to XLSX

File Name and Document are mapped from a prior module. Worksheet Numbers and MergeKey Columns use 1-based indexing as comma-separated strings.

Parameters

Required: Connection, File Name, Document, and Worksheet Numbers must all be provided. MergeKey Columns and Output Format are optional — leave MergeKey Columns empty to remove only exact duplicate rows; Output Format defaults to XLSX.

ParameterRequiredWhat it doesExample
ConnectionYesPDF4me API connection. Click Add and paste your API key if connecting for the first time.Your PDF4me connection
File NameYesExcel filename with extension. Map from the prior module's file name output.orders_export.xlsx
DocumentYesBinary Excel buffer from a cloud storage download (Google Drive, Dropbox, SharePoint), email attachment, or HTTP response.1. Data
Worksheet NumbersYesComma-separated 1-based worksheet numbers to process. Worksheet 1 is the first tab. At least one number is required.1,2
MergeKey ColumnsNoComma-separated 1-based column numbers used as the grouping key — column 1 is A, column 2 is B. Rows matching on all key columns are merged. Leave empty to remove only exact duplicate rows.1,2
Output FormatNoFormat for the output file: XLSX (default, modern Excel), XLS (legacy), XLSB (binary, smaller), or CSV (first worksheet only as plain text).XLSX

Quick Setup

  1. Add PDF4me ExcelMerge Rows to your Make scenario.
  2. Select Connection (or click Add to create one with your API key).
  3. Map File Name and Document from a prior cloud storage download or email attachment module.
  4. Enter Worksheet Numbers as a comma-separated string of 1-based tab numbers (e.g. 1 or 1,2).
  5. Enter MergeKey Columns as 1-based column numbers — for example 1 to group by column A, or 1,2 to group by columns A and B together. Leave empty to remove exact duplicates only.
  6. Choose Output Format and click Save. The document output is the deduplicated workbook — pipe it into an upload module to save or distribute.

Workflow Examples

Workflow ExamplesCommon Make scenario patterns using Merge Rows in Excel.
Consolidate customer orders by ID
  1. A scheduled trigger downloads the daily orders export Excel from Google Drive.
  2. Merge Rows runs with Worksheet Numbers "1" and MergeKey Columns "1" (CustomerID in column A).
  3. All order lines per customer are collapsed into one row — order numbers, products, and amounts joined with semicolons in their respective cells.
  4. The consolidated XLSX is uploaded to the customer service Google Drive folder for same-day review.
Remove exact duplicate rows from data imports
  1. A Dropbox Watch Folder triggers when a new data file is dropped into the import folder.
  2. Merge Rows runs with MergeKey Columns left empty — every column is a key so only fully identical rows are removed.
  3. The first occurrence of each duplicate is kept; all subsequent copies are discarded.
  4. The clean file is moved to the processed folder and an email notifies the data team of the duplicate count removed.
Roll up product data to category level
  1. A weekly trigger downloads the product catalog Excel from SharePoint.
  2. Merge Rows runs with MergeKey Columns "1,2" (Category and Subcategory) — all product SKUs within each category are merged into one row.
  3. Output Format is set to CSV for direct import into the product database.
  4. The CSV is uploaded to the database import folder and a webhook notifies the data pipeline to begin ingestion.

Frequently Asked Questions

What exactly happens to values in non-key columns when rows are merged?+
When rows share the same key column values, all values from every other column are joined into a single cell using "; " as the separator. If multiple merged rows have the same value in a non-key column — for example the same product category appearing twice — that value appears only once in the merged result. Duplicates within the combined values are removed automatically.
How do I remove exact duplicate rows without merging any values?+
Leave MergeKey Columns empty. When no key columns are specified, every column in the row becomes part of the key. Only rows where every single cell is identical across two or more rows are collapsed — the first occurrence is kept and all exact copies are removed. This is the standard way to deduplicate a data export that has repeated rows.
Can I process multiple worksheets at once with the same key column settings?+
Yes. Enter all target worksheet numbers as a comma-separated string in Worksheet Numbers — for example "1,2,3" processes the first three tabs. Each worksheet is deduplicated independently using the same MergeKey Columns setting. The output workbook contains all processed worksheets.
What is the difference between XLSX, XLS, XLSB, and CSV output?+
XLSX is the modern Excel format and is the default — it works with all Excel versions from 2007 onwards. XLS supports legacy systems that require the older format. XLSB is binary Excel — it produces smaller files and opens faster, which is useful for very large datasets. CSV exports only the first worksheet as plain comma-separated text, ideal for direct database imports.
Are the worksheet and column numbers 0-based or 1-based?+
Both are 1-based. Worksheet 1 is the first tab in the workbook, worksheet 2 is the second. Column 1 corresponds to Excel column A, column 2 to B, and so on. Enter multiple values as comma-separated strings — for example "1,3" to use columns A and C as the merge key.

Get Help