I am currently building a cash flow tool to visualize and forecast cash flow within a calendar view.
I built out the calendar so that the headers are the dates and the days show the up to date cash amount (as seen below)
Below the calendar I have three tables: expenses, income, and debt schedule. Those three tables each include an amount cell and a date cell.
I then developed a formula using MATCH and INDEX functions that I drop into each day of the calendar view that looks at the date value in the cell above it and then looks for a corresponding date in each of the three tables below. If it finds that date it will either add or subtract values depending on my instructions to give me the running daily cash flow.
However, if the table includes more than one of the same date (multiple expense entries on the same date, etc) the MATCH function only finds and returns the first one. This isn’t helpful as it won’t give me the full cash flow picture.
How can I change this formula to find and include all of the values that have a matching date?
Here is the formula I am using in the days on the calendar:
=(IF(ISNUMBER(MATCH(E5,$D$19:$D,0)),((INDEX($C$19:$C, MATCH(E5, $D$19:$D,0)))),0))
+ (IF(ISNUMBER(MATCH(E5,$H$19:$H,0)),((INDEX($G$19:$G, MATCH(E5, $H$19:$H,0)))),0))
- (IF(ISNUMBER(MATCH(E5,$N$19:$N,0)),((INDEX($L$19:$L, MATCH(E5, $N$19:$N,0)))),0))
Each of the rows looks for values that correspond to the date above it (in the image here it’s looking at June 26). The first row of the formula finds expenses on that date, the second finds income on that date, and the third row is looking at the debt schedule.
The problem is that if I have multiple expense entries for this date, it only finds the first one. I want it to find all of them.
Josh Hester is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.