# How can I add data to an existing excel file?

**URL:** <https://forum.knime.com/t/how-can-i-add-data-to-an-existing-excel-file/34977>\
**Category:** KNIME Analytics Platform\
**Tags:** excel\
**Created:** [July 28, 2021, 6:53pm UTC](https://forum.knime.com/t/how-can-i-add-data-to-an-existing-excel-file/34977 "2021-07-28T18:53:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shmelky](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@Shmelky](https://forum.knime.com/u/Shmelky)\
**Post date:** [July 28, 2021, 6:53pm UTC](https://forum.knime.com/t/how-can-i-add-data-to-an-existing-excel-file/34977/1 "2021-07-28T18:53:45Z")

</div>

I have a work flow taking data and cleaning it. I need to add the cleaned data to a specific Excel file. I can’t just export the data as a new Excel, it has to be added to that specific file.

Attached is the raw data, workflow and the excel template file I need to populate. You can see where the data should go in the Template file (starting at row 3).

Raw data:  
[MP2 Energy\_Reflective.xlsx](https://forum.knime.com/uploads/short-url/8TYiT6IJur8vFchmv6pDtg6bAc0.xlsx) (10.2 KB)

Template:  
[!PaymentTemplate.xlsx](https://forum.knime.com/uploads/short-url/fGLM65wye3dBGym9EbaanLSsMaj.xlsx) (11.5 KB)

Workflow:  
[KNIME\_ExcelAppend.knwf](https://forum.knime.com/uploads/short-url/8QG6h9UUGFJ27A9pDAfv9WQkkLd.knwf) (24.2 KB)

Thank you

---

<div class="post-metadata">

**Author:** ![elsamuel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/e/b4bc9f/32.png) [@elsamuel](https://forum.knime.com/u/elsamuel)\
**Post date:** [July 28, 2021, 9:47pm UTC](https://forum.knime.com/t/how-can-i-add-data-to-an-existing-excel-file/34977/2 "2021-07-28T21:47:57Z")

</div>

What difficulty have you been having?

Have you tried reading in the template, concatenating the processed data, then using the Excel Writer to overwrite the template?

![image](https://forum-cdn.knime.com/uploads/default/original/3X/d/1/d14615b0a2343d46b5b9f2a8cc17c54e5081df0c.png)

This is the output of the concatenate node:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/a/2/a2f33c3c42c995c8daa9df24afd995326c629319.png)

---

<div class="post-metadata">

**Author:** ![Shmelky](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@Shmelky](https://forum.knime.com/u/Shmelky)\
**Post date:** [July 29, 2021, 4:12am UTC](https://forum.knime.com/t/how-can-i-add-data-to-an-existing-excel-file/34977/4 "2021-07-29T04:12:06Z")

</div>

The template needs to look exactly the same meaning the blank row at the top as row 1 (asides for what you see in cells A1, B1) and the “headers” on line 2 and then the data directly underneath stating in row 3 (the template file I uploaded had dummy data in rows 3,4,5…, so I cleared that out before reading it into Knime)

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [July 29, 2021, 1:39pm UTC](https://forum.knime.com/t/how-can-i-add-data-to-an-existing-excel-file/34977/5 "2021-07-29T13:39:34Z")

</div>

Hello @Shmelky,

currently Excel Reader node doesn’t feature such a possibility. But there is ticket to have it and I have added +1 to it. (Internal Reference: AP-14911)

For now you can try following approaches:

- @elsamuel suggestion along with [Continental Nodes for KNIME](https://kni.me/e/JPEQiK3qwxAJb5tU) extension to format Excel files
- [Write To Excel Template – KNIME Hub](https://kni.me/n/y7AwntQqYbCQA6cq) Community node
- Python (see [here](https://forum.knime.com/t/write-data-to-excel-sheet-on-row-10/12897/6))

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![AnotherFraudUser](https://forum-cdn.knime.com/user_avatar/forum.knime.com/anotherfrauduser/32/16912_2.png) [@AnotherFraudUser](https://forum.knime.com/u/AnotherFraudUser)\
**Post date:** [July 29, 2021, 3:01pm UTC](https://forum.knime.com/t/how-can-i-add-data-to-an-existing-excel-file/34977/6 "2021-07-29T15:01:29Z")

</div>

@ipazin could you give a +1 from me as well? 🙂

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [July 30, 2021, 9:18am UTC](https://forum.knime.com/t/how-can-i-add-data-to-an-existing-excel-file/34977/7 "2021-07-30T09:18:10Z")

</div>

Done @AnotherFraudUser.  
Ivan

---

<div class="post-metadata">

**Author:** ![knimediger](https://forum-cdn.knime.com/user_avatar/forum.knime.com/knimediger/32/19981_2.png) [@knimediger](https://forum.knime.com/u/knimediger)\
**Post date:** [July 30, 2021, 7:44pm UTC](https://forum.knime.com/t/how-can-i-add-data-to-an-existing-excel-file/34977/8 "2021-07-30T19:44:18Z")

</div>

@Shmelky  
Not sure whether my idea will solve your problem completly.

My idea would be to keep the headers in a static KNIME table. Then do all required calculation from all of your input.  
As last step make a “union” of the header table and the data table using the Concatenate Node [Concatenate — NodePit](https://nodepit.com/node/org.knime.base.node.preproc.append.row.AppendedRowsNodeFactory)  
Please keep in mind that the columns in both tables must be equal…

The already mentioned Continental Nodes allow you to do some formatting in the table if required.

At the end just write the output to xls.

It depends on further use of the output (do you use it only for viewing / printing / do you apply some math to the table / …) this might be a solution.

---

<div class="post-metadata">

**Author:** ![SamirAbida](https://forum-cdn.knime.com/user_avatar/forum.knime.com/samirabida/32/28904_2.png) [@SamirAbida](https://forum.knime.com/u/SamirAbida)\
**Post date:** [August 1, 2021, 8:42am UTC](https://forum.knime.com/t/how-can-i-add-data-to-an-existing-excel-file/34977/9 "2021-08-01T08:42:39Z")

</div>

Hello @Shmelky,

Maybe it can be done if you don’t rename the columns right away.  
It’s simpler to append your data if you keep the columns as A, B, C to join data later. :  
Result :

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/9/7/9725df4b962b93137e29dc6ae5bb366696b93679.png)  
(PS: I shrank the columns to make the image bigger, but data are okay).

Check it and tell me if it’s what you are looking for :  
[KNIME\_ExcelAppend\_modified.knwf](https://forum.knime.com/uploads/short-url/eFH1EKhL2wDuLJn3Kcr5VJ6J4IE.knwf) (43.5 KB)

Hope that help you.

Br,  
Samir

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [January 30, 2022, 8:42pm UTC](https://forum.knime.com/t/how-can-i-add-data-to-an-existing-excel-file/34977/10 "2022-01-30T20:42:47Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
