# Excel to XRechnung

Fill the template, drop the workbook, download an XRechnung 3.0 UBL file.

Source: https://tally-stick.com/excel-to-xrechnung

## How it works

Download the template from the page, fill it in, and drop it back onto the same page. You get one XML file per invoice row, named after the invoice number. Nothing is uploaded: the workbook is parsed and the XML is written in your own browser, within the site's fair usage limit.

Two sheets, and the names matter. A workbook whose sheets are called anything other than `Invoice` and `Lines` is rejected. `Invoice` carries one row per invoice: number, dates, currency, type code, buyer reference, Leitweg-ID, then seller and buyer name, VAT number, address, email, company registration number and type, then IBAN and payment terms. `Lines` carries one row per line item, tied back by invoice number.

Line totals are always recomputed from quantity times unit price, so there is no column for them. Several invoices in one workbook is fine: the line rows find their invoice by number.

## What is checked before anything is written

The file is refused, with the reasons listed, when a field EN 16931 treats as mandatory is missing. That covers the invoice number, a valid `YYYY-MM-DD` issue date, a buyer reference or Leitweg-ID, seller and buyer name, street, city, postcode and a two-letter country code, an electronic address for each party, at least one line, a positive quantity, a description per line, and a VAT rate inside 0 to 100. Totals are then computed rather than trusted: net per line, taxable base per VAT rate, tax per rate, and the gross total.

## Common questions

### Which number format should I type?

Either. 1.234,56 and 1,234.56 both read as 1234.56, because whichever separator comes last is treated as the decimal one.

### Does it need the Leitweg-ID?

Only under XRechnung, and only if there is no buyer reference. One of the two has to be there; a B2B invoice usually has the buyer reference and no Leitweg-ID.

### What about zero-rated lines?

A VAT rate of 0 is written as category Z, a rate above 0 as category S. Leaving the cell empty is refused rather than treated as zero, because a forgotten rate and a genuine zero are not the same invoice. For reverse charge, an export, an exemption or a supply outside VAT's scope, two extra columns, `VAT category` and `Exemption reason`, let a line say which one and why; leave them blank and Automatic still applies.

### Can I go the other way?

Yes. [XRechnung to Excel](https://tally-stick.com/xrechnung-to-excel) reads a finished file back into a spreadsheet.

### I would rather type the invoice than fill a sheet.

[Create XRechnung](https://tally-stick.com/create-xrechnung) is a form, and it writes the same file.

## Related tools

- [XRechnung to Excel](https://tally-stick.com/xrechnung-to-excel)
- [XRechnung to PDF](https://tally-stick.com/xrechnung-to-pdf)
- [PDF OCR to XRechnung](https://tally-stick.com/pdf-to-xrechnung)
- [Create a credit note](https://tally-stick.com/create-credit-note)
