#266 ✓invalid

Errors in budget calculations, possibly leap-year related

Reported by frog | June 19th, 2011 @ 02:55 PM

I've noticed that my budgets for next year, in the year view are too high, and in the month view are too low.

I have a $1000 per year budget item, which for the next financial year (1st july to 30th june in Australia) shows up as $1360.71 for 2011-12 (which I notice includes a leap-year's 29th of February) and thereafter is back to around $1000 per year.

Depending on the date the budget is considered to have started, the values change around quite a bit.

I've created a test document with 12 budget items, each a yearly $1000 value, each with a different starting month in 2010, and each with its own account. If I look at the current period (whether its month/quarter/year), the values are all the same, but only some of them make sense. Here are, for the 19th of June, the current budget amount for each budget item starting in the months specified:

  • Jan = 56.41
  • Feb = 48.67
  • Mar = 43.14
  • Apr = 38.46
  • May = 34.81
  • Jun = 31.70
  • Jul = 1,000.00
  • Aug = 261.90
  • Sep = 150.68
  • Oct = 106.80
  • Nov = 82.09
  • Dec = 67.07

There's 12 days left in the period including today, so I would expect to see around 1000 * (12/365) = $32-33 ish depending on exactly how it calculates the days left in the period (e.g. if it calculates whole days or uses the time).

I can't really see how the starting date for a budget item should affect how much is available for the rest of this period, provided the budget started before the current date (these were all started in 2010).

If I go to expected profits & losses for July 2011, the values are all quite different, varying from 84.70 for the item started in July 2010 up to $738.10 for the value started in August 2010.

If I look at the whole year, for next year (which in Australia runs July 2011 to June 2012), i.e. entirely in the future so the budget should just say $1,000 for each, I see:

  • Jan = 1440.86
  • Feb = 1363.90
  • Mar = 1291.11
  • Apr = 1210.86
  • May = 1132.31
  • Jun = 1050.49
  • Jul = 1000.00
  • Aug = 1653.40
  • Sep = 1679.92
  • Oct = 1641.83
  • Nov = 1581.84
  • Dec = 1514.90

This is all in the Profit & Loss sheet. It certainly seems like a $1,000 annual budget should not be showing up as exceeding $1000 in almost all cases!

In the Net Worth sheet shows the totals for all 12 budget items in the "Net Worth" row and "Budgeted" column as the sums of the above values, showing $1,921.73 for the next 11-12 days, then 18,483.15 for the 2011-12 financial year, and $30,476.72 for the 2012-13 financial year. These seem to add up to the expected values reported in Profits & Loss.

The problem seems to go away from 2012-13 onwards, so it seems like the bug relates to the current date, and the current/next years' budget calculations, perhaps limited to leap years since next year happens to be one.

It doesn't appear to be affected by:
- starting date of the budget (if i moved them to 2009 or 2001 without any effect, and for Jan to May items, starting them in 2011 also had no effect). - The "Year starts in" preference (mine is set to July, but I changed it a few times without seeing any variations in the numbers).

Hope that's enough info for you to figure out what's going on.

Comments and changes to this ticket

  • frog

    frog June 19th, 2011 @ 02:57 PM

    • Title changed from “budget oddity in leap years” to “Errors in budget calculations, possibly leap-year related”
  • Virgil Dupras

    Virgil Dupras June 21st, 2011 @ 11:26 PM

    • Tag changed from budget to budget, bug

    Thanks, I don't know if that's enough, but that's certainly a lot :) I'll check this out shortly.

  • Virgil Dupras

    Virgil Dupras June 22nd, 2011 @ 11:43 PM

    A cursory look seem to indicate that the budgeting calculations are right. The problem seems to stem from an incomprehension of how such calculation works (maybe that the help file should explain that). I admit it's a bit complicated, but let me explain:

    Let's start with the annual budget starting in january. We're the 19th of june, so we are 170 days into the year. This means that there are 195 days left to our period. We haven't spent anything from the budget, so we still have to allocate our 1000$ evenly in those next 195 days, that means about 5.1282$ per day. We're the 19th of june, there's 11 days left to the month (moneyGuru doesn't count today in budget calculations). 5.1282 * 11 = 56.41

    February: We have more days left to our period because it ends in february. We have 195+31 (226) days left. Per day, that's 4.4248$. Times 11, that's 48.67.

    Let's skip to July. July is the last month of our yearly period, and we have to allocate it all before the end of the month, that's why we got 1000$.

    Again, I admit that the budgeting calculations are complex. I also find them quite complex myself, but I don't see how they could work otherwise.

    If you agree with my calculations, I'll consider this issue closed.

    edit: oops, I wrote 19th of july instead of 19th of june.

  • frog

    frog June 23rd, 2011 @ 03:28 AM

    Okay, yep this explains it all, thanks! I think a useful piece of advice for users is that they should align annual budgets with the month their year starts on to avoid confusion.

    I went over the second list of values with the same calculations to check it still made sense, so I'll leave them here for anyone else reading this who happens to suffer the same confusion as me:

    If we look at annual budget starting in January, over the period of July 2011 to June 2012, there are two separate budgets to consider: The one from Jan 2011 to Dec 2011 and the one from Jan 2012 to Dec 2012. Since the year contains days from both budget periods, they both contribute. The Jan 2011 to Dec 2011 budget contributes the same $5.1282 per day ($1000/195d), applied to the 184 days from July 2011 to Dec 2011 giving $943.59 ($5.1282x184d). The Jan 2012 to Dec 2012 budget contributes $2.73224 per day ($1000/366), applied to the 182 days from Jan 2012 to June 2012 giving $497.27 ($2.7322x182d). Combined that's $1440.86.

  • Virgil Dupras

    Virgil Dupras June 28th, 2011 @ 04:56 PM

    • State changed from “new” to “invalid”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket