Summing Weekly Meeting Packages Revenue - excel-formula

I'm selling my services in a package of 10 meetings with different prices per client.
I need a way to calculate my weekly revenue over the year.
The current formula is very messy and creates problems when moving clients around the sheet:
"=count(C2)$B$2+count(C3:C6)$B$3+count(C7:C9)$B$7+count(C10)$B$10"
I wish I could use SUMPRODUCT but since the meetings are numbered it ruins the calculations.
Do you have an easier way to execute this?
Simplified Example:
https://docs.google.com/spreadsheets/d/1LA_y7CBipVIstQfyVqqRTd2pkSQzRiPsjwZQYyvHuTg/edit?usp=sharing

=SUMPRODUCT($B2:$B10,--(C2:C10>0))
(C2:C10>0) is an array of TRUE and FALSE values of whether there is a meeting for that client.
“--“ of that is the trick that converts a TRUE/FALSE array into a binary arrays of 1s and 0s suitable for sumproduct.
Then fill across.

Related

Facing difficulty in Excel when creating a logic for moving average of different variables

So, the point is, in my dataset I have to create a variable "Moving Avg. Amt paid per sq. ft." and the formula or the logic I need is to calculate the last five values as per most recent transactions. i.e. most recent sales by date. but this average should only return value in case it matches the same building and same area variable.
This is what my data looks like
Area ID has three categories. Building number has 5 categories. Date is sorted in ascending order. Now my variable moving average should calculate last 5 averages w.r.t date but for the same building in the same area. e.g. there are buildings 1 and 2 in area 102. I need my Mov Avg. variable to calculate using conditions when it matches criteria of building 1 in 102 for past five sales and when it finds building 2 in the building number variable, it should calculate average of last 5 sales of that building in area 102.
So my approach to this issue was (which is flawed at the moment):
I calculate average of amount paid per sq. foot w.r.t area & building based on dates using the formula
=AVERAGEIFS($N$2:$N$6547,$D$2:$D$6547,D14,$C$2:$C$6547,C14,$B$2:$B$6547,B14)
but I cannot make this formula work, to calculate moving average whenever it meets the criteria. I tried the offset the point as well by 5 but the logic is not right and hence its not working and returning #value in the cells. The formula I used to offset the above condition is
=AVERAGEIFS((OFFSET(N13,5,,5)),$D$2:$D$6547,D13,$C$2:$C$6547,C13,$B$2:$B$6547,B13)
(These formulae are used in column Q of my data)
Need a support from the community as I am badly stuck in making this data useful and I am out of any ideas to make this work.
Edit 1: I am not sure how I can attach my excel file here so you may review the dataset. I have uploaded it on a third party site, for which the link is shared below, so you can view the file in detail.
https://file.io/hlciAHJOHzWA
Expected result is as I have mentioned the instruction said
"Create a variable called "mov. avg amt. paid per sq ft". For each row, this variable should calculate average amt paid per sq ft for the most recent past five sales (by date) for the same building in the same area."
And my approach to build a logic or formula to make this variable calculate moving average w.r.t date for same building in the same area doesn't seem to work because there might be some flaws.
In Office 365 you could use:
=LET(f,FILTER($N$1:N13,($B$1:B13=B14)*($C$1:C13=C14),""),
c,COUNTA(f),
s,SEQUENCE(5,,c-5),
IFERROR(IF(c<5,SUM(f)/c,SUM(INDEX(f,s))/5),""))
If there's less than 5 matches prior to the current sales it'll calculate the average of the count. If 5 or more matches it'll calculate the average of the last 5 prior to the current sale.

Excel - Find highest MULTI-cell Total

Hello!
Is it possible to have Excel find the largest two, three or four cell total within its data? For example, dates are entered as 2000, 2001, 2002, etc in column A and in column B, there's another figure, HRs. I have my document sorted by dates (columnA) and now want to see the most HRs hit over two seasons. This seems very useful and utilized in data but still under-realized.
-Most touchdowns over a two-season stretch. (most touchdowns over a THREE season stretch etc.)
-Highest-grossing 3-month stretch.
-Rainiest two days ever
-Most speeding tickets issued in two days.
-Largest two-day Jeopardy winnings.
-ETC
Can I search through an excel document and see the largest 2-day rainfall as described? Something similar to "Find All" in excel but for consecutive cells, though, that doesn't find largest I suppose. It'd be cool, if you could drag a range, say 3 cells tall, within a larger range, and Excel could find that largest totals in that larger range.
I doubt this is possible---but surely there is a way data scientists or just newspapers can organize data to find the largest total over a certain stretch? (most HR over a 5-season stretch) How could I do this? Maybe this requires a program for SQL or something? Thank you.
https://www.exceltip.com/summing/sum-the-largest-two-numbers-in-range-in-microsoft-excel.html
This seems close, but just finds the two largest figures----not the two largest consecutive figures, which is what I'm looking for.
Using offset ranges:
=MAX(B2:B12+B3:B13)
or subtotal/offset combo:
=MAX(SUBTOTAL(9,OFFSET(B1,ROW(B1:B11),0,2,1)))
(the first one gets cumbersome when extended to 3,4,5... adjacent cells)
must be entered as array formulas using CtrlShiftEnter
EDIT
If you wanted to find the first, second etc. largest pair you could use Large instead of Max:
=LARGE(B$2:B$12+B$3:B$13,ROW()-1)
or
=LARGE(SUBTOTAL(9,OFFSET(B$1,ROW(B$1:B$11),0,2,1)),ROW()-1)
and then to find the year, use Index/match:
=INDEX(A$2:A$12,MATCH(F2,SUBTOTAL(9,OFFSET(B$1,ROW(B$1:B$11),0,2,1)),0))
The only drawback of this is that if there were two pairs giving the same maximum of 84 say, the index/match would still match the year of the first one. This can be addressed but maybe that is enough for now.

Allocating weighted sales revenue to reporting dates

I'm trying to find a way to distribute revenue to specific dates and weight out the numbers. So that if a day falls between my two reporting days, I want it to allocate it based on the difference between the reporting days. So for example if I have reporting dates
20/11/2017
30/11/2017
10/12/2017
20/12/2017
and sale dates with revenue
Sales dates Volumes
22/11/2017 600,000,000
12/12/2017 -100,000,000
13/12/2017 -141,400,000
20/12/2017 -100,962,000
I want the sale made 22/11/2017to be distributed 8/10 to 20/11/2017and 2/10 to 30/11/2017and so on, so that the 4 sales would distribute to
Reporting dates
20/11/2017 480,000,000
30/11/2017 120,000,000
10/12/2017 -178,980,000
20/12/2017 -163,382,000
I have not successfully found any solution, anyone know if I have missed something or have any good ideas how one good build such a settup?
Ok, this solution uses a lot of helper columns as I haven't had time to condense it all down. I'm sure these formula can be improved and maybe even turned into a single formula.
First step is to find the two dates that your revenue should be distributed between.
With your original data in cells A1:B4 this formula placed in cells C1:C4 will return the higher date:
=DATE(YEAR($A1),MONTH($A1),CEILING(DAY($A1),10))
and this, placed in D1:D4 will return the lower date:
=DATE(YEAR($A1),MONTH($A1),FLOOR(DAY($A1),10))
Edit: After spending a bit more time awake you could replace the above two formula with =CEILING($A1,10)-1 and =FLOOR($A1,10)-1 respectively.
Next we find where the sale date is in relation to the upper and lower dates.
In E1:E4 use:
=(C1-A1)/10
and in F1:F4:
=(A1-D1)/10
Now to return the revenue based on that distribution:
In G1:G4 use:
=E1*$B1
The formula in H1:H4 differs slightly as the 100% figure should only be returned once. The revenue for 20/12/2017 will only appear in column H.
=IF(F1=0,B1,F1*$B1)
I've placed the reporting dates in the range J1:J4; so 20/11/2017 in J1, 30/11/2017 in J2, etc.
The formula in K1:K4 is:
=SUMIF(C$1:C$4,$J1,$H$1:$H$4)
The formula in L1:L4 is:
=SUMIF(D$1:D$4,$J1,$G$1:$G$4)
Finally the formula to return your distribution will sum the previous two formula in cells M1:M4:
=SUM(K1:L1)

How to calculate relative average cost by department in excel?

So I am trying to calculate the average cost of On-Hand goods in this example. The goal of this would be to determine the overall cost of goods by department. This would be achieved arithmetically by taking the average cost of the good and multiplying it by the number of goods on hand for that item, and then repeating for each item. I would then want to add items from the same numerical departments to get a department item cost. Is there a way to do this within a single function in excel? So far I have:
=IF($B$2:$B$17=F2,SUMPRODUCT($C$2:$C$17,$D$2:$D$17),"null")
but it is returning an invalid output.
For Cell J2, the output I would want to look for is: $74093.80
The reason I want to do this by function is because I have a spreadsheet with over 76,000 items and 19 different departments on it and need to calculate the Average Inventory Cost of each Department.
Thank you in advance!
Click here for Excel sheet
Put the test inside the SUMPRODUCT():
=SUMPRODUCT(--(B$2:$B$17=F2),$C$2:$C$17,$D$2:$D$17)

How Do I Nest IF Functions in Order to Calculate Daily Revenue?

I am working on a data set and I need to calculate the daily revenue of fake AirBnb listings using nested IF statements. This is for a bootcamp I am attending, and I am stuck.
My instructions are as follows:
Estimate revenue per listing
Assume each booking always has 2 guests, unless the listing accommodates only one;
The booking is always for the minimum number of days allowed;
Only half of the bookings generate a review;
The extra person charge is per night (column name ‘extra_people’)
○ Format: have a column that calculates daily revenue (account for number of guests accommodated, number of guests included in the price, extra charge for additional people - using nested IF statements); another column would then calculates revenue per booking; finally, multiply that by the number of total stays the listings has had.
Using the data in my dataset, I am attempting to fill out column AA. So far this is what I have for my formula,
However, I get an error. I know the first part of this formula would work for the scenario in row 4. However, I need to make sure that the formula takes into account scenarios where the "guests included" is less than the "accommodates", because I must assume that each booking always has two guests except for when the listing only accommodates one person.
How should this formula be written? Can I not create equations within nested if formulas if it includes adding, subtracting, dividing, or multiplying columns together?
To clarify the previous response a bit more, the structuring of IFstatements is important. Keep in mind the structure of the function: =IF(logical test, value if true, value if false). So, the second IF function (the first nested) needs to be placed where the first "value if false" comes in - each additional IF needs to be within the previous IF function. Using your example, the corrected form would be =IF(W4=Q4,V4,IF(W4<Q4,Q4*V4...)). I'm not sure what the "+X4" is supposed to be adding to, but this hopefully makes the structure clearer for you to work with. Good luck!

Resources