Forum Discussion
Complicated formula help for a budget spreedsheet
Hello everyone,
Normally I can find what I'm looking for and apply it to my project, but this one is a bit complicated, if it can even be done. I'll try to explain it as best as I can.
I've got a calendar type layout on one tab(Forcast Template), with bills listed on anoter tab(All Bills). What I'd like to get it to do, is automatically fill in each bill for the corresponding day. The complications are as follows: some days have multiple bills due, and some bills only apply to certain months. I'm familiar with if/then functions as well as xlookup, but combining the two for this application is proving to be a tad more complicated. Again, that's if it can be done.
Not sure how to attach the file for viewing, but I'll post screenshots so hopefully you can tell what I'm trying to do. Let me know if I need to clarify anything. Thanks!
3 Replies
- SnowMan55Bronze Contributor
On a new post, you can attach a file by clicking on the link as shown here (inside the red rectangle that I added):
But it is possible that the forum is set up to prevent new users from attaching files on their first post (or first few posts), to reduce spam/malicious uploads.
See the attached workbook for an alternative solution.
XLOOKUP is good for retrieving a single value/row, but you need the FILTER function to retrieve multiple, possibly noncontiguous values. More information and links to resources are on the _Info worksheet.
- PeterBartholomew1Silver Contributor
It would be a complicated formula. I have assumed you have Excel 365 and are not averse to advanced formula writing (pretty big assumptions). I have also assumed that each cell of your calendar is identified by the month (short form) and the day (digit). Those two values are used to filter the table and return matches.
= LET( PaymentDueλ, LAMBDA(d,m, LET( crit, (day=d)*(REGEXTEST(month, m)+(month="All")), billsDue, FILTER(bill, crit), ARRAYTOTEXT(billsDue) ) ), MAP(calendarDay, calendarMonth, PaymentDueλ) )
By now you may be having second thoughts about the course of action?
- mathetesSilver Contributor
Creating a workbook to track expenses is a great application for learning Excel. Looking at what you're doing, though, I'm wondering if you would consider going about this in a different way.
I'll attach what is obviously a simple (maybe even simplistic) example. The heart of it, at the "input" end of things, is a dataset of transactions, very much like what you show here, except that what mine does (and how I actually do this in real life) is just record expense after they've been experienced, whether paid by credit card, check, automatic withdrawal (e.g., rent or mortgage).... there's no reason why you couldn't put in future expenses as well, especially where the date and amount are known in advance.
And then the approach I recommend uses that "raw data" on actual expenses (and income) to create a Pivot Table. If you've not learned about the Pivot Table yet, I think you'd find it very useful: it can create what's called a cross-tabulated summary of years worth of data. In the case of an expense tracking sheet, the most helpful way to do it, as the example does, is to summarize with budget categories down the vertical side of the the table, months across the top, and then the total expenses (or incomes) for each month next to the appropriate category. The nice thing about the Pivot Table--it does all the work. No formulas needed. Here's a reference you might find useful in your learning.
And take a look at the attached example. I'd be happy to engage further with you, but I strongly recommend that you consider doing something along these lines.