Divide revenue across quarters in two years - Excel and SmartSheet - excel-formula

I need a formula to:
recognize the quarter for each date
divide the revenue in half for the start and end quarter.
Below is an example of the results I'm looking for. Need this to be a formula I can build in SmartSheet and/or Excel and transfer over to a SmartSheet.

Add a "helper row" with quarter number and year so you can use a SUMIFS/2
=(SUMIFS($[Est Revenue]#row, $[Start Date]#row, IFERROR((ROUNDUP(MONTH(#cell) / 3) + "" + YEAR(#cell)), 0) = [Q1 2020]$1) + SUMIFS($[Est Revenue]#row, $[End Date]#row, IFERROR((ROUNDUP(MONTH(#cell) / 3) + "" + YEAR(#cell)), 0) = [Q1 2020]$1)) / 2
The helper row would be quarter number before the 4 digit year. So 12020 would be quarter 1 2020.

Related

Placing arrays in cells with Excel VBA

I use the following Excel custom function to put a value into cell based on a start and end date, and a frequency. The spreadsheet is for projecting costs into the future, so I may allocate $10k every 5 years starting from 2022 and ending in 2072 (eg 2022, 2027, 2032....2067, 2072). I also index it also sometimes.
Current Macro
Public Function spend(FY, start, finish, frequency, amount, index, base)
'Check if FY is within range if not return nothing and exit
If FY < start Or FY > finish Then
spend = ""
Exit Function
End If
'Check frequency to see if valid year
If FY = start Then
spend = amount * (1 + index) ^ (FY - base)
ElseIf (FY - start) Mod frequency = 0 Then
spend = amount * (1 + index) ^ (FY - base)
Else
spend = ""
End If
End Function
Current Spreadsheet
For some larger projects, the costs may spread over multiple years (eg Year 1:$100k, Year 2:$500k, Year 3:$600). Is there a way to put a series of numbers into "Amount" cell. For example if this project repeats every 10 years from 2022 simliar to below:

Create a rolling date list in Excel

I want to create a rolling list of dates in Excel like so:
Day Date
Day 1 01-Jul-19
Day 1 02-Jul-19
Day 1 03-Jul-19
Day 1 04-Jul-19
Day 1 05-Jul-19
Day 1 06-Jul-19
Day 1 07-Jul-19
Day 2 02-Jul-19
Day 2 03-Jul-19
Day 2 04-Jul-19
Day 2 05-Jul-19
Day 2 06-Jul-19
Day 2 07-Jul-19
Day 2 08-Jul-19
Day 3 03-Jul-19
Day 3 04-Jul-19
Day 3 05-Jul-19
Day 3 06-Jul-19
Day 3 07-Jul-19
Day 3 08-Jul-19
Day 3 09-Jul-19
Day 4 04-Jul-19
. .
. .
. .
So essentially what's happening is that the 7-day range moves forward by one day each time, from a specific start date (in the example above, 01-07-19) until it reaches an end date. Is there an automated way of doing this?
#ashvin10 you can do this in vba, but you can also accomplish this with 2 formulas without using vba at all, here's how:
for illustration purposes we'll just assume you are starting with 07/01/2019 on the first row and your information will be displayed in columns A and B.
in A1 enter the string Day 1
in B1 enter your starting date, like 07/01/2019
in A2 enter this formula: ="Day " & IF(MOD(ROW(A2),7)<>0, MID(A2,5,(LEN(A2)-4)), MID(A2,5,(LEN(A2)-4))+1)
in B2 enter this formula: =IF(A2=A1,B1+1,OFFSET(B2,-7,0)+1)
highlight cells A2 and B2
click on the cross that becomes available on the bottom right hand corner of cell B2
drag down the formula till you hit the end date you desire
the cells are populated with the values you requested in the format you requested
If you absolutely have to have it done using vba please let me know and I can show you how to do it that way as well, but this way is much easier.
EDIT: #ashvin10 I'm so sorry, the original formula I instructed you to put into A2 only works for Day 1 through Day 9, if you go into days past 9 it won't display correctly. I've fixed the formula that should be pasted into A2 so now it will work no matter how many days you go down. I'm so sorry for the confusion.
Alternatively, this can also be done in Python.
import datetime
start_date = '01-07-2019'
end_date = '31-01-2020'
output_file_name = 'rolling dates'
output_file_extension = '.CSV'
delimiter = '\t'
with open((output_file_name + output_file_extension.lower()), 'w+') as file:
header = "Day" + delimiter + "Date" + '\n'
file.write(header)
start_date_object = datetime.datetime.strptime(start_date, '%d-%m-%Y').date()
end_date_object = datetime.datetime.strptime(end_date, '%d-%m-%Y').date()
number_of_days = abs((end_date_object - start_date_object).days)
next_day = start_date_object
for i in range(1, number_of_days + 2):
for j in range(7):
file.write(("Day {0}" + delimiter + next_day.strftime('%d-%m-%Y') + '\n').format(i))
next_day += datetime.timedelta(days=1)
start_date_object += datetime.timedelta(days=1)
next_day = start_date_object
After running the code above, I simply created a blank Excel file and then imported the data from the CSV file output by this code.
This is arguably more complicated than #gharbad-the-weak's answer but thought I'd include this anyway.

Formula to Calculate Subscriber Churn Revenue

I'm trying to sum up 12 months of subscriber revenue factoring a 6% monthly churn (assuming no signups) to come up with the one-year value of a subscriber. A simple future value gives me the start and end values, but I'm looking to get the sum of the monthly declining revenues in a single Excel / Google Sheets formula. I can make 11 entries (plus the starting month full value), but is there a better one-liner or formula for this?
This gives me the 12th-month revenue:
=FV(-6%,11,0,100)
I'd like to get the sum without this:
=100 + FV(-6%,1,0,100) + FV(-6%,2,0,100) ... FV(-6%,11,0,100)
You are looking for the sum of a finite geometric series:
1 + r + r^2 + r^3 .... + r^11
And the sum of this series is
(1 - r^12) / (1 - r)
where r = 1 - 6%
So the formula would be
= (1 - (1-6%)^12 ) / (1 - (1-6%) ) * 100
This is assuming the OP meant
=100 + FV(-6%,1,0,-100) + FV(-6%,2,0,-100) ... FV(-6%,11,0,-100)
as FV(-6%,1,0,100) would output a negative number
I don't know much about such math but would the following formula give you the result?
=100+SUMPRODUCT(FV(-6%,ROW(1:11),0,-100))
The formula works in both Excel and Google Spreadsheets

Excel Datedif with dates prior to 1900

How can I calculate the difference between two dates in Excel older than 1900? For example between 05/05/1862 and 04/16/1938. Thank you very much.
Excel stores dates as number of days since 1900, so one option might be to convert them to dates after 1900. For example, if A1 contains the text 05/05/1862, then this formula results in 05/05/3862:
= LEFT(A1, 6) & RIGHT(A1, 4) + 2000
and the difference in number of days between two text dates can be:
= (LEFT(A1, 6) & RIGHT(A1, 4) + 2000) - (LEFT(A2, 6) & RIGHT(A2, 4) + 2000)

Formula to calculate salary after x year?

Knowing that i am getting paid $10 000 a year, and that each year my salary increase by 5%.
What is the formula for Excel to know how much i will get in 5 year?
Thank you for any advise
The formula in Excel is:
=VF(5%;5;0;-10000)
Which results in: $12,762.82
If your Office is english version you can use:
=FV(5%;5;0;-10000)
=(10000*((1 + 0.05)^5))
The Compound Interest Equation
P = C (1 + r/n)^nt
Where...
P = Future Value
C = Initial Deposit/Salary
r = Interest Rate/Pay Increase (Expressed as a Fraction: EX = 0.05)
n = Number of Times per Year the Interest/Pay Raise Is Compounded (0 in Your Example)
t = Number of Years to Calculate
The Formula is POWER(B1,C1)*10000, and the cell B1 is (1+5% ), the cell C1 is the number of years
current = 10 000
for each year -1
current = current * 1.05
end for
current now has current salary for the given number of years

Resources