Cash-flow forecasting in excel - excel

I would like it to be able to input contract details (name of the client, duration of the contract and total yearly amount ). Using these contract details, I would like for the program or template to populate a calendar in which we can see each day's deposits.
For example: If I entered 2 contracts:
Total yearly amount of 120$ that start on 01/01/2019
Total yearly amount of 180$ that start on 01/03/2019
by choosing to view March calendar, I would see on the 01/03/2019 2 deposits one of 10$ and the other of 15$ for a total of 25$. But, If I choose to view the month of February, I would see on 01/02/2019 1 deposit of 10$.
I have started an excel sheet which populates it perfectly if it is one time deposit for a specific date.
Where I got stuck was for monthly deposits and special deposits (special conditions where the first month required 25% of the total yearly amount, and will complete the remainder 75% of the total yearly amount in 5 equal deposit the following months).
Here is my basic formula I have put on each day for the month of Janurary:
=IFERROR(IF(AND(VALUE(LEFT(Inputs!$D3,2))=B$2,(VALUE(MID(Inputs!$D3,4,2))='C.F. JAN'!$B$1)),IF(Inputs!$C3="Fixed Monthly",Inputs!$G3/12,IF(Inputs!$C3="Yearly",Inputs!$G3,"")),""),"")
Here is the one of Februrary:
=IFERROR(IF(AND(VALUE(LEFT(Inputs!$D3,2))=C$2,(VALUE(MID(Inputs!$D3,4,2))='C.F. FEB'!$B$1)),IF(Inputs!$C3="Fixed Monthly",Inputs!$G3/12,IF(Inputs!$C3="Yearly",Inputs!$G3,"")),""),"")
I have created sheets for each month that sum the amounts each client's appropriate deposit.
#jessi here is how my data looks like:
here is the formula on M3:
=SUMIF($D$3:$D$10000,$L3,$H$3:$H$10000)+SUMIFS($I$3:$I$10000,$D$3:$D$10000,"<"&$L3,$J$3:$J$10000,">="&$L3)

So, you can do some preliminary math so that your if statements are very simple.
Here's an example. see the added columns? You could enter the data for Contract, Value, Start, First, and Installments. Calculations for FirstPayment, NormalPayment, and Stop.
FirstPayment, for contract a, Row 2, calculated as:
=IF(ISBLANK(D2),G2,D2*B2)
NormalPayment for contract a, Row 2, calculated as:
=IF(ISBLANK(D2),B2/E2,(1-D2)*B2/E2)
Stop for contract a, Row 2 calculated as:
=IF(ISBLANK(D2),EDATE(C2,E2),EDATE(C2,E2+1))
Then, the months with their payments expected, look like so (the formula for January shown):
NOTE: the date 2019-01-01 is in A7, the result (where this formula goes) is in A8. Copy and paste for rest of columns.
=SUMIF($C$2:$C$4,$A7,$F$2:$F$4)+SUMIFS($G$2:G$4,$C$2:$C$4,"<"&$A7,$H$2:$H$4,">="&$A7)
Note that the first SUMIF is dealing with anything that is in its first month. The SUMIFs is dealing with anything that is between Start and Stop.
Edit for changed question to show cashflow by day
To show by day, you first need to add another column, let's say column I, to the data table for contracts. This is the DAY column. DAY($C2). To keep things simple for your cashflow, actually make this If(day($C2)>28),1,day($C2)) to make any falls on 29, 30, or 31 to show up on the next first. You can make other choices here.
Then, you can have each day in time in your cashflow sheet.
I put the cashflow on a new tab and named the contracts data tab CONTRACTS
The cashflow formula (with date in $A2 and result in $B2) is:
=SUMIF(CONTRACTS!$C$2:$C$5,$A2,CONTRACTS!$F$2:$F$5)+SUMIFS(CONTRACTS!$G$2:G$5,CONTRACTS!$C$2:$C$5,"<"&$A2,CONTRACTS!$H$2:$H$5,">="&$A2,CONTRACTS!$I$2:$I$5,DAY(A2))

Related

Calculating Monthly (Offset) Average In Excel

I have daily data entries for 3 indices. They do not feature every day of the month and for some days entries for one of the indices will miss; the quantity of cells per month differ. I want to calculate the average value for these individual indices starting the 16th of the prior month and going to the 15th of the current month (or the first date after the 15th/last day before the 16th if there is no entry). For example, in the screen grab below, the average for MXWO in the month of February would be the average of the array B14:B36 (and for January, B2:B13).
What my data looks like
I want to produce 4 columns: Date (Month-Year), average of MXWO, average of JPMIGHYS, and average of USTWBGD. Each of these averages needs to use the methodology described above. How might I achieve this?
I've tried using the OFFSET function, but since the cell increment changes month to month (there is a different amount of missing cells per month), this didn't work.

Formula to offset a value in excel to a different column?

I am trying to create a formula that offsets an "up-sell" amount 12 periods (columns) in the future.
For background: Each of our customers provides monthly recurring revenue (like a subscription. At the beginning of the model (1/1/18), I have a random number generator from 1-20 that calculates the period in which the customer could be up-sold.
As you can see in the photo and the formula that the IF statement looks at the random upsell period and adds in the additional revenue ($100) into that period and periods after that.
I am trying to create the formula so that once the if statement is satisfied (the random period >= the period that the cell is in) it adds the revenue 12 periods later, not in that period itself.
For example, Customer ABC's random upsell period is 3, instead of adding that revenue in period 3, I want it to add it in period 15 (12 periods later).
The formula that is currently being used is: =IF($B8>E$5,$C8,$C8+$D$3)
Please see attached image for reference, thank you]1
Not sure if that's what you are looking for and only works if your periods increments in 1 even after 12++ (13,14,15...).
Sorry you'll have to redefine the references but that gives you an idea:
In C5 : IF(C$4>12,IF(OFFSET(C4,0,-12)>=$A5,$C$2+$B5,$B5),$B5)

Excel - Lookup - Multiple result across multiple worksheets

Im doing a work calendar, that should be filled automatically depending of the day of the week or of the day of the month. Meaning:
I have weekly chores (each are equally every week) and monthly chores (each are equally for every specific work day of the month).
The idea is every time i change the month of the calendar, is filled with the chores needed to be done for each day.
This is the calendar that i'm doing (the red cells are filled by hand, the rest is automatically filled with the formula below):
Calendar
Week Chores sheet
Sheet ToDos week
Month Chores sheet
Sheet ToDos Month
I already filled the weekly chores automatically with:
=IFERROR(INDEX('ToDos Week'!$C$3:$C$98;SMALL(IF((WEEKDAY($C$3;2)='ToDos Week'!$B$3:$B$98);ROW('ToDos Week'!$B$3:$B$98)-MIN(ROW('ToDos Week'!$B$3:$B$98))+1;"");ROWS($L$1:L3)));"")
Works like a charm
But my difficulty now is to add the monthly chores
I Tried to add
=IFERROR(IFERROR(INDEX('ToDos Week'!$C$3:$C$98;SMALL(IF((WEEKDAY($F$3;2)='ToDos Week'!$B$3:$B$98);ROW('ToDos Week'!$B$3:$B$98)-MIN(ROW('ToDos Week'!$B$3:$B$98))+1;"");ROWS($L$1:L1)));INDEX('ToDos Month'!$C$3:$C$91;SMALL(IF((NETWORKDAYS(F$5-DAY(F$5)+1;F$5;holidays)='ToDos Month'!$B$3:$B$91);ROW('ToDos Month'!$B$3:$B$91)-MIN(ROW('ToDos Month'!$B$3:$B$91))+1;"");ROWS($L$1:L1))));"")
of course doesn't work because the part "ROWS($L$1:L1)" of the formula will stretch and will not give me the first occurrence of the month chores (in case there's week chores in the same day), but the third or fourth..
Can you help me with this?
{Big Edit} Okay, I've just realised I overlooked a really simple solution - as demonstrated in an earlied edit, we can use COUNTIF to get the number of Daily Tasks for the weekday. So, we can subtract this from the Monthly Task count to correct the number.
To Simplify: Is the task Weekly or Monthly? (You may need to add/subtract from ROWS to get it to line up)
=IF(COUNTIF('ToDos Week'!$B$3:$B$98,WEEKDAY($C$3,2))>=ROWS($L$1:L3), "Weekly", "Monthly")
Use your existing code for Weekly. For Monthly, just subtract COUNTIF('ToDos Week'!$B$3:$B$98,WEEKDAY($C$3,2)) from the ROWS to remove all the Weekly tasks:
IFERROR(INDEX('ToDos Month'!$B$3:$B$98;SMALL(IF((DAY($C$3;2)='ToDos Month'!$A$3:$A$98);ROW('ToDos Month'!$A$3:$A$98)-MIN(ROW('ToDos Month'!$A$3:$A$98))+1;"");ROWS($L$1:L3)))-COUNTIF('ToDos Week'!$B$3:$B$98,WEEKDAY(C$3,2))>=ROWS($L$1:L3);"")
Replace the "Weekly" and "Monthly" in the IF above, and you get:
=IF(COUNTIF('ToDos Month'!$B$3:$B$98,WEEKDAY(C$3,2))>=ROWS($L$1:L3),IFERROR(INDEX('ToDos Week'!$C$3:$C$98;SMALL(IF((WEEKDAY($C$3;2)='ToDos Week'!$B$3:$B$98);ROW('ToDos Week'!$B$3:$B$98)-MIN(ROW('ToDos Week'!$B$3:$B$98))+1;"");ROWS($L$1:L3)));""),IFERROR(INDEX('ToDos Month'!$B$3:$B$98;SMALL(IF((DAY($C$3;2)='ToDos Month'!$A$3:$A$98);ROW('ToDos Month'!$A$3:$A$98)-MIN(ROW('ToDos Month'!$A$3:$A$98))+1;"");ROWS($L$1:L3)))-COUNTIF('ToDos Week'!$B$3:$B$98,WEEKDAY(C$3,2))>=ROWS($L$1:L3);""))
Old answer below
Okay, there are 2 possible solutions I can think of here... The first, and simplest, only works if your Weekly Tasks and Monthly Tasks are formatted differently (e.g. Monthly tasks may all start "[M]", such as "[M]File Invoices") In that case, replace the ROWS(L$1:L3) with a COUNTIF to count the Monthly tasks (e.g. COUNTIF(L$1:L3;"[M]*"))
If you have no 'easy' way to check weekly/monthly, the next option would be to use a SUM in the Array Formula to compare each entry in $L1:L3 against the ToDos Month list (e.g. SUM(COUNTIF('ToDos Month'!$B$3:$B$91;L$1:L3)), taking advantage of the fact that a COUNTIF where both arguments are arrays will itself return an array)
These 2 options should give you the number of Monthly tasks in your day, for the k of your SMALL function
{EDIT:Removing the 'blank' column} This needs redoing for each week/row. It is based on my test sheet, where cell A14 was 05/02/2018, E14 was 09/02/2018 and the array formula was put into A15 and filled down-and-right to E23
=IF(COUNTIF('ToDos Week'!$B$3:$B$98,WEEKDAY(A$14,2))>=ROWS(A$14:A14),IFERROR(INDEX('ToDos Week'!$C$3:$C$98,SMALL(IF((WEEKDAY(A$14,2)='ToDos Week'!$B$3:$B$98),ROW('ToDos Week'!$B$3:$B$98)-MIN(ROW('ToDos Week'!$B$3:$B$98))+1,""),ROWS(A$14:A14))),""),IFERROR(INDEX('ToDos Month'!$B$3:$B$98,SMALL(IF((DAY(A$14)='ToDos Month'!$A$3:$A$98),ROW('ToDos Month'!$A$3:$A$98)-MIN(ROW('ToDos Month'!$A$3:$A$98))+1,""),COUNTIF(A$14:A14,"Month*")+1)),""))
First thing it does it check how many Weekly tasks there are for the day. If this is greater than the number of tasks already filled out, it looks for a Weekly task, otherwise it looks to a Monthly task - counting the existing Monthly tasks as starting with "Month"

Time series mock data generation for 16 years of quarterly data in Excel or Matlab

I would like to generate a mock time series quarterly dataset from, say, 2000-2016 for a variable (quarterly credit growth) that averages around a certain value (say, 30%). Can anyone give a suggestion on how to do this in principle?
Edit: what I was implying were the actual data values for each time period, i.e. data with a certain mean and variance.
Found a solution with a code in Matlab, for anyone interested, see below in answers.
Excel approach:
You can make column A your date list. In A1, or A2 or more if you have header rows, you will have to seed your list by providing the first start date. Lets assume you put your seed date in A2. I would then go about adding 3 month to you start date using a formula, and copy down until you have hit your desired date. In order to add the 3 months I would use the following in A3.
=date(year(A2),Month(A2)+3,day(A1)
that will give you the first day of the month every 3 months. If you want the first day of the month every 3 months, set the day to 1 like so:
=date(year(A2),Month(A2)+3,day(A1)
And end of month could be calculated as:
=eomonth(date(year(A2),Month(A2)+3,day(A1)),0)
however I would prefer to do the end of month calculation based on the row you are in so I would do it more like:
=EOMONTH($A$2,(rows($A$2:A3)-1)*3)

Calculate the days it took to clear each bills with partial payments in excel

I have a CSV file with the following info:
Date Bills Payment
31-08-14 490882
03-09-14 -200000
03-09-14 950880
04-09-14 -600000
06-09-14 1028976.8
08-09-14 -668000
09-09-14
09-09-14 368616.4
10-09-14 -750000
12-09-14 1111322.6
13-09-14 737780.4
14-09-14 -50000
18-09-14 -425000
21-09-14 -1000000
Here is the CSV file: https://docs.zoho.com/file/9de9d171bda4412374843adde73f5249f5c8c
I need to calculate the days it took to pay each Bill.
Problem: there lies some balance after each partial payment.
For each Bills > 0, I need to SUM Payment column UNTIL -(Bill) <= SUM of Payment. And calculate the days.
Update:
I made a separate column for each bill and ran this formula:=IF($E$3:$E5>-$D$3,"",TEXT($B$6-$B$3,"DD")&" Days")
On the following excel sheet: Link to Excel Sheet
Try this formula
=IF(B2="","",IFERROR(INDEX(A$2:A$10,MATCH(TRUE,SUMIF(A$2:A$10,"<="&A$2:A$10,C$2:C$10)<=-SUM(B$2:B2),0)),"Unpaid"))
I'm just testing it on a small number of rows so that I can follow the arithmetic more easily.
It finds which is the earliest dated payment you need to include to clear the current bill and all previous bills.
Must be entered as an array formula starting in D2 using CtrlShiftEnter
Then to find the days elapsed, in E2:-
=IF(ISNUMBER(D2),D2-A2,"")

Resources