On 14 April 2025 at 12:22, Peter Graham Eastwood said: > Hi > I want to split a utility bill to a fixed percentage for each person. It > occurs quarterly but I don’t necessarily need it to be a scheduled > transaction, though it could be. I just want to enter the (variable) bill > total and have it set up the split in the same way repeatable roughly each > quarter. In the Wiki I found a formula for splitting a phone bill in a SX: > > | Phone | Assets:Checking | <A> | | > | Mike | Expenses:Phone | | <B> | > | Bob | Assets:Money Owed To Me:Bob | | <C> | > | Sally | Assets:Money Owed To Me:Sally | | <D> | > > Where: > <A> := base + sally_ld + bob_ld + mike_ld > <B> := base/3 + mike_ld > <C> := base/3 + bob_ld > <D> := base/3 + sally_ld > > However, I’m a new gnucash user (though I have programmed computers) so > I don’t know where/ how to start setting up and using a formula like > this. Can anyone help me get going? Regards Graham Sent from my iPad
I suggest you start by entering one transaction as you would like it. You could do this from the Assets:Bank account, with splits as needed. (It could be a fictitious one, which you delete afterwards. And of course you'll do this in your "testing" file first, to practise until you have the hang of it. Once you have it as you want it, right-click the txn and choose "Schedule". This will take you to the SX Editor. In the "template" tab, replace the values in the "debit" and "credit" columns with formulas along the lines of the above example. In the "Frequency" tab you might want to set "Monthly" and "every 3", or perhaps "weekly" and "every 13". Read up on SXs for more detail. When you run the thing, it will prompt for the variables by name, so it's a good idea to make them meaningful. In the simplest case, you might end up with something like ! Assets:Current-account ! ! billtotal ! Expenses:Utility:Electric ! billtotal/3 ! ! Assets:Debtors:Joe ! billtotal/3 ! ! Assets:Debtors:Bert ! billtotal/3 ! if you want a 3-way equal split, for example. If the split varies from period to period then you'll need more variables, but as a programmer you can deal with that. Note that in the above, if the "billtotal" isn't divisible exactly by 3 then there will be an imbalance. Adjusting the formulae to deal with this is an exercise for the reader ... When it comes to entering it into your "real" file, you can of course create the SX directly in the SX Editor (via the "Actions" menu). HTH .. F _______________________________________________ gnucash-user mailing list gnucash-user@gnucash.org To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user ----- Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All.