EXCEL - How to spread X amount over N number of months - excel

I am creating a revenue recognition model that tells the user the specific months X amount of revenue falls into based on specific start date. For example, I have an invoice dated 1/1/17 for $1200 total in monthly services that will be incurred over the next 3 months ($400 per month)
I want to create the model so the user enters the invoice date "1/1/17", the invoice amount "1200", and the number of months the invoice amount is spread over. In this case "3".
The model is setup with 24 columns which have the MM/YYYY header in each column. "Jan 2017, Feb 2017..Dec 2018". As the user enters the date, amount and # months, the values per month "400" will populate in Jan, Feb, and March 2017. The remaining months will have zero or be blank because no revenue will be allocated in those months.
I don't want anyone to give me the answer here, but I don't even know if this is possible in excel without using VBA. Some insight in how to get started would be helpful. Thanks!

This could be a start:
B1, B2 and B3 are the input cells. B1 must be a date not a string.
D1 to O1 are the months. The values must be dates, not strings, but could then be formatted to show only month and year. Format MMM YYYY for example.
You need only inputting D1 and E1 as dates 2017-01-01 and 2017-02-01, then select D1:E1 and fill to right. Then a series will be created having from step to step the difference of E1 - D1, which is 1 month in this example.
Formula in D2 is
=IF(AND(D$1>=DATE(YEAR($B$1),MONTH($B$1),1),D$1<=DATE(YEAR($B$1),MONTH($B$1)+$B$3-1,1)),$B$2/$B$3,"XX")
and can be filled to right as needed. In the example up to O2.
Now if you are changing any of the input cells, the values in D2 to O2 will also changing due to the formula.

Related

Automatically change excel cell value depending on current Month

Stock analysis Dashboard. I need to compare the stock from today vs the previous 6 months.
My stock data
Cell A1:R1 - month data example Cell A1= June 2017, B1= 7/2017 ....till R1= December 2018.
Cell A2:R2 Stock numbers data example A2=23, B2=25,........till R2=50.
IF I want to see the stock today month which is July 2018= M1 vs six months February 2018 H2 and the stock level calculation will which is M2=26 - H2= 30 =-4.
But instead of entering formula every time I need to be updated every month based on the today month?
Any tips on how to do it?
Thanks
I also miss a date...
If you use today() function to identify today's date you can use:
=HLOOKUP(TODAY(),$A$1:$S$2,2)-HLOOKUP(DATE(YEAR(TODAY()),MONTH(TODAY())-5,1),$A$1:$S$2,2)
If you need a cell with a specific date, replace today() formula with that cell.
I find the question a bit confusing. If A1 is June 2017, I am missing a month if R1 is December 2018 and July 2017 is in M1. Also, even though you said 6 months, I am assuming that you want 5 months so that July compares to February.
This response assumes that A1 is wrong but R1 and M1 (and B1 through R1 are accurate) and that the values in A1 through R1 are actually an Excel date that is formatted as m/yyyy (as opposed to some text representation of a date).
This formula is further complicated since I do not know what day is used in the date representation in A1 through R1, hence I am adapting both that date and the current date to be a fixed day of the month (I chose the first day of the month in my formula).
Here is the formula that computes the -4 assuming M1 is 7/2018, M2 is 26, H1 is 2/2018, H2 is 30 and we want to compare column M to column H since today is in July and we want to compare July to February (5 months difference):
=INDIRECT("R2C"&MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0),FALSE)-INDIRECT("R2C"&MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0)-5,FALSE)
This is an array function so it needs to be entered with [Ctrl]+[Shift]+[Enter].
The way it works is that it computes from today's date, the date value equal to the first day of this month. Then it compares that against the range A1:R1 with each of those dates likewise moved to the first of the month. This gives us the column to use for "this month" and using the same computation but subtracting 5 gives us the column to use for "six months ago." Out of sheer laziness I used these values in an indirect cell reference to pull the Row 2 values for "this month" and "six months ago" and subtracted the latter from the former (i.e., "this month" - "six months ago").
In other words, this part of the formula gives me the column of the current month:
MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0)
and this part gives me the column of the month six months ago (as defined in the original post):
MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0)-5
As I indicated, this may not be what you wanted, but this is what I thought you were asking.
Alternate version using INDEX function
=INDEX(A2:R2,MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0))-INDEX(A2:R2,MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0)-5)
The above would also be entered as an array formula.

excel - drop down list with condition

Maybe the title of the question is wrong, but I'll try to explain what I'm looking for. I have in cell A1 a drop down list to select months (from 1-12). Is it possible to automatically fill the rest of the A column with hourly data for the whole selected month. For example if it's selected "3" in A column'd be:
Time
1.3.2018 1:00:00
1.3.2018 2:00:00
1.3.2018 3:00:00
...
31.3.2018 22:00:00
31.3.2018 23:00:00
1.4.2018 0:00:00
Maybe, something like second drop down list.
Or maybe, it can be done with substitute, but then some months have 31 days, some 30, and february 28, and there is a problem with daylight saving time. In 3rd month, there's one day where I need to have 23 hours (jump from 02:00 to 04:00), and in 10th month one day with 25 hours (02:00, 02:00, 03:00).
In cell A2 enter the following formula:
=DATE(2018,A1,1)
Then custom format the cell with type:
d.m.yyyy hh:mm:ss
In Cell A3 enter the following formula:
=A2+1/24
And change the cell format as above, then drag the cell down to autofill until you have the full month.
There would be multiple ways, but one way is to first determine number of rows required (for March it would be 31 * 24 = 744), set first row using DATE function and then keep adding 1 hour until the desired row number is reached.
Calculate number of rows required in A2: =DAY(EOMONTH(A3,0))*24+ROW()
in A3 enter =DATE(YEAR(TODAY()),A1,1)
in A4 enter =IF(ROW()<=$A$2,A3+1/24,"") and drag down till about 800.
This will make it dynamic for number of days in month

Calculate updated workdays from today

I have the following formula:
=NETWORKDAYS.INTL(C7,TODAY(),$E$2:$E$500)
Which I want to calculate the working days from the starting of the month (c7) to present day today. However I am getting a #num error any suggestions?
Example.
6/01/16 - today (6/21/16) = 15
tomorrow
6/01/16 - today (6/22/16) = 16
I'm doing a sales per day average that's why I would like it to update based on the date.
Assuming your data is in column A and you want result in column B. Place this formula in Cell B2 and drag it down.
=NETWORKDAYS(A2,TODAY())
Here is the data that I've used.
In cell B4, I have added +1 in formula just to show you the result based on tomorrow's date.
You will need to change the reference.

Subract a series of business days from a Date

I have a given START DATE and series of milstones that happen on all business days. I need to calculate the given DATE based on subtraction of NETWORKDAYS (Business days + Holidays) from the date. Here is the data:
Start Date: (A1) 6/30/2014
Business Days to subtract:
B1-B3:
3
5
7
In a perfect world, I want to type in this function: =subtractnetworkdays (6/30/2014-B1) with the result being (6/27/2014) or if a weekend (6/25/2014).
=IF(A1,WORKDAY(A1, $B$1 * -1),"")
Note that the $B$1 is required so when you copy the formula to other cells, the same amount of business days gets subtracted. The IF statement has been added to not show #VALUE! inside the blank cells. The cell will remain blank until a date is entered.

How To automatically calculate Qtr Revenue given only two dates and Total Revenue

I could use some help writing an excel formula.
Case: Revenue is generated between 2 dates, Date A and Date B.
These dates could go into the next year and spread across quarters.
How can I split Revenue into Q1 Revenue, Q2 Revenue, Q3 Revenue, Q4 Revenue just based on my 2 dates and Total Revenue.
My thought was first identify which Qtr your dates fall into and then have an if statement that logically figures out the % and multiplies by the revenue.
Currently I'm using this formula to determine Qtr: =ROUNDUP(MONTH(DateA)/3,0).
Similarly for DateB.
Then, =if(DateAQtr=2, ((6/30/2013-DateA)/(DateB-DateA))*Revenue, 0)
There are clearly problems with this like, what happens if DateB(end Date) is in Q1 of the following year.
Denominator will always be Date B - Date A, giving you total days.
Numerator of Start Qtr is =(LastDayofQtr - Start).
Numerator of any quarters in the middle will be the full qtr length.
Numerator of End Qtr is =(EndDate - LastDayofPreviousQtr).
This is the logic. I'm trying to write into Excel formula to automate the process.
I made some named ranges to help see what is going on.
A2 = DateA, B2 = DateB, C2 = Revenue
A7 =DATE(YEAR(DateA),1,1) This is to establish the Q1 date for the DateA entered.
A8 =EDATE(A7,3) dragged down to cell A15 as in the picture. This returns the start of the next Quarter.
B7 =IF(AND(DateA>=A7,DateA<A8),A8-DateA,IF(AND(DateB>=A7,DateB<A8),DateB-A7,IF(AND(A7<DateB,A7>DateA),A8-A7))) This is checking how the dates compare to the Quarter start dates and returning the number of days our DateA and DateB date range contain for each Quarter.
C7 ="Q"&ROUNDUP(MONTH(A7)/3,0) dragged down to read the Qtr Start Date and return the corresponding Q#.
D7 =IF(B7=FALSE,"",C7&"-"&YEAR(A7)) returns the Q# and year when the days column is not false.
E7 =IF(D7="","",(Revenue/(DateB-DateA)*B7/Revenue)) This calculates the percentages of revenue that each quarter contains.
If you change the values of DateA or DateB everything still calculates properly. If you date range is larger than the two years displayed just drag the formulas down to expand the max range.
I hope this helps.

Resources