Skip to content

Instantly share code, notes, and snippets.

@sfinkens
Last active October 7, 2024 19:57
Show Gist options
  • Save sfinkens/c472f1a5a7558f6fcbfb46dd13c6ff29 to your computer and use it in GitHub Desktop.
Save sfinkens/c472f1a5a7558f6fcbfb46dd13c6ff29 to your computer and use it in GitHub Desktop.
Elterngeld Berechnung in Google Sheets

Elterngeld Calculation in Google Sheets

This macro calculates the parental allowance (Elterngeld) in Germany within a Google spreadsheet. We used it for our planning and the results match well with the official calculator (Elterngeldrechner).

Note: You are not paid exactly these amounts, but the average parental allowance over all months of entitlement. This is also what is displayed by the official calculator.

This macro comes without warranty. Please report any errors!

Setup

  1. Create a new spreadsheet.
  2. Click on Extensions -> Apps Script. A new tab is opening.
  3. Copy the elterngeld.gs snippet below into the project and hit save.
  4. Go back to the spreadsheet.

Usage

Take a look at this example sheet

Explanation:

  • Column A is the age of your child in months
  • Column B is the type of Elterngeld:
    • mama: Maternity Benefit (Mutterschaftsleistung)
    • basis: Basis-Elterngeld
    • plus: Elterngeld Plus
    • bonus: Partnerschaftsbonus
  • Column C is your income in that month. In this example the person takes care of the baby for 6 months full-time and then starts working part-time.
  • Cell H1 is your pre-birth income
  • Column D is the calculated parental allowance. Double-click in cell D2 and type: =elterngeld(B2, $H$1, C2). Pull down the cell for all months.
function elterngeld(type, income_pre_birth, income) {
// Source: https://familienportal.de/familienportal/familienleistungen/elterngeld/faq
if (type == "mama") {
// Maternity Benefit, 100% of pre-birth income
return income_pre_birth;
} else if (type == "basis") {
// 65% of income difference, but 1800€ max.
return Math.min(1800, 0.65 * (income_pre_birth - income));
} else if (type == "plus" || type == "bonus") {
// 65% of income difference, but max. half of the maximum basic parental allowance
var eg_basic_max = Math.min(1800, 0.65 * income_pre_birth);
return Math.min(
0.5 * eg_basic_max,
0.65 * (income_pre_birth - income)
);
} else {
return 0;
}
}
@keremciu
Copy link

there is typo,

instead of typ it should be type in the code.

@sfinkens
Copy link
Author

sfinkens commented Oct 7, 2024

there is typo,

instead of typ it should be type in the code.

Thanks for your message! Actually it wasn't a typo, but the German word for type (typ), which is a valid argument name. But obviously the German words are confusing, so I translated everything to English 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment