> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/tasks/merge-excel-files.md).

# Merge several Excel files into one sheet with Duaer

In Duaer, upload several xlsx files, read every row, tag each with its source file, remove duplicates, and export one combined sheet. No formulas and no AI credits.
## Merge Excel files in Duaer

1. Add [Form Trigger](/build/form-trigger.md) with one File field labelled Sheets, Multiple Files on, Accepted File Types .xlsx,.xls.
2. Add [Code](/build/code.md), rename it Split files, and paste the code below for one item per file.
3. Add [Extract from File](/build/extract-from-file.md) with Operation Extract From XLSX. Keep the defaults when headers are in row one; set Sheet Name under Options to read one sheet. Each row becomes an item.
4. Add [Edit Fields](/build/edit-fields.md), turn on Include Other Input Fields, and add source with {{ $('Split files').item.json.fileName }}.
5. To drop duplicates, add [Remove Duplicates](/build/remove-duplicates.md) and compare on a key column such as order number.
6. Add [Convert to File](/build/convert-to-file.md) with Operation Convert to XLSX for one combined sheet.

```
const out = [];
for (const item of $input.all()) {
  for (const key of Object.keys(item.binary ?? {})) {
    out.push({
      json: { ...item.json, fileName: item.binary[key].fileName },
      binary: { data: item.binary[key] },
    });
  }
}
return out;
```

## When column names differ

Duaer merges by column name. The same column named Amount in one file and Total in another becomes two columns. Rename them to one name in Edit Fields before exporting.

## Duaer online tools

- [Merge Excel and CSV files online (columns matched by header)](https://doc.duaer.com/tools/merge-excel-files.md)
- [CSV to Excel converter (free, no upload)](https://doc.duaer.com/tools/csv-to-excel.md)
## Questions

### Does merging Excel files in Duaer cost credits?

No AI credits. Reading, de-duplicating, and exporting in Duaer do not call a model.

### Can Duaer merge a mix of CSV and Excel files?

Yes, read them separately: in Duaer, split by extension with Switch, use Extract From CSV and Extract From XLSX, then join with Merge.

## Related

- [Read a file with Extract from File in Duaer](https://doc.duaer.com/build/extract-from-file.md)
- [Write a file with Convert to File in Duaer](https://doc.duaer.com/build/convert-to-file.md)
- [Remove duplicate items in Duaer](https://doc.duaer.com/build/remove-duplicates.md)
- [Extract PDF invoices into an Excel sheet with Duaer](https://doc.duaer.com/tasks/pdf-invoices-to-excel.md)

