The excel user will export the data from an online website to excel (12 months data), so the data will be all the time different.
I need the past 6 months and 12 months average (However, the calculation need to use the months I have in the data, and sometimes there will be less then 6 or 12 months), but I still need to get the average and frequency for it , however, I am not sure how to get it.
I am trying to write a code, but it is not complete and is not working as well, I don't get an error; it just doesn't work.
I am open for Excel formulas as well, the problem may be the last row and that it need to use the data I have to calculate and not 6 and 12 months full.
PS: I post a similar question on https://www.ozgrid.com/forum/index.php?thread/1227312-dynamic-way-to-calculate-the-last-6-months-average/
Will This formulas work for you?
Average for last 6 months:
=AVERAGEIF(A:A;">="&EDATE(MAX(A:A);-6);B:B)
Frequency for last 6 months:
=IF(MONTH(MAX(A:A)-MIN(A:A))>=6;COUNTIF(A:A;">="&EDATE(MAX(A:A);-6))/6;COUNTIF(A:A;">="&MIN(A:A))/MONTH(MAX(A:A)-MIN(A:A)))
Average for last 12 months:
=AVERAGEIF(A:A;">="&EDATE(MAX(A:A);-12);B:B)
Frequency for last 12 months:
=IF(MONTH(MAX(A:A)-MIN(A:A))>=12;COUNTIF(A:A;">="&EDATE(MAX(A:A);-12))/12;COUNTIF(A:A;">="&MIN(A:A))/MONTH(MAX(A:A)-MIN(A:A)))
Related
I have a issue with my excel project. What I want to do is to divide number of working hours to cells when particular person has a working day. Right now I use QUOTIENT formula with combination with others but the problem is I'm not getting the right split of the total. So set up looks like that
Number of hours = 72
Number of Working days = 7
So I need to divide 72/7 but I need to have the result rounded to full figure (hour). So for example I need day 1 = 10h day 2=12h and day 3 to 7 each = 10h. The QUOTIENT is resulting 10h in every single day giving me result of total 70 not 72.
The problem is that the variables will change when the employee will be switched so for example the next employee will have 94 hours and 11 days. Generally its look like that that I have range of full month so from 1 to 31 and the working days are collected from "working schedule". The idea is to sum up the hours to a month normative working hours. So for example employee has 104 hours and he is working 12 days in working schedule but the monthly norm is 176 so we have 72 hours missing and those hours should be added to those days that he is working.
Example.
You can use MOD function to calculate the remainder.
so day 1 and 3 to 7 should have =quotient(72,7)
and day 2 should have =quotient(72,7)+mod(72,7)
I suppose from your question that you want the remaining hours to be added to day 2.
I am trying to calculate revenue that is delayed by 4 months from the beginning of the year before receiving the full expected amount in month 5 and for the rest of the year.
In the attached picture you see that I expect 10,000 every month in 2021 with a 4 month ramp meaning in month 1 I will only receive 2,500 which is 10,000/4. In month 2 I will receive 5,000 which is 20,000/4 (10,000 from month 1 + 10,000 from month 2) and so on.
The problem is that the formula I use =SUM(OFFSET($G$14,0,0):G14)/$G$16 continues to sum and divide after month 5 and I would like it to stop at month 4.
I'd appreciate any help on tweaking my formula or recommending one.
Thanks
So I played around with the formula and figured out a solution. Tweaking the formula to the below allowed me to resolve the delayed revenue in case it helps anyone else.
=SUM(OFFSET($G$14,0,IF(MONTH(G11)<=$G$16,$G$16-$G$16,MONTH(G11)-$G$16)):G14)/$G$16
I'm having a hard time getting my head around what I think is a simple enough problem.
I have an Excel table of hours by day for each user i.e.:
Date1, Date1+1, Date1+2, Date1+3,... Date1+n
User1 8 8 4 6 ... 2
User2 5 2 8 3 ... 7
User3 0 7 5 0 ... 8
For forecasting purposes this grid looks several months into the future.
I do my work daily, others want it by week. I'd like to automatically generate the same table of data but rolled up by WeekNum.
I tried setting a year-weeknum at the top of the daily table and then using a SumIfs function to compare the user name and week num to sum up the daily hours in another tab for weekly data but I just couldn't get it to function properly.
=SUMIFS('Act - Forecast Hours'!$G$6:$AAL$35,'Act - Forecast Hours'!$A26,$A25,'Act - Forecast Hours'!S$4,O$3)
I think I'm overcomplicating a solution, any help is appreciated.
TIA
Rob
OK, I may have come up with an approach.
Since on my main Hourly Sheet the format is fixed, i.e. each week is 7 days and increments.
I setup a second sheet where I called a vertical and a horizontal offset and used the following formula:
=SUM(OFFSET('Act - Forecast Hours'!$G$9,$A5,D$2,1,7))
$A5 and D$2 refer to offset counts that increment by 7. As you copy the formula to each cell it increments the Row / Column to point to the right spot. Then for the Height and Width I look at a grid 1 row high and 7 wide to select each day of the week.
It works, I'm happy. I'm certainly interested in a more refined approach if there is one :-)
Thank You to anyone that does read through the question!
Regards
Rob
I'm trying to make a calculator that calculates the amount of years, months and days from one date to another. The problem is that the calculation of days not always is accurate, or at least I don't think it is. I have downloaded four age calculators from GooglePlay store, and two of them sometimes give me a different result.
When I use the dates as shown in the picture some of the two of the calculators give me the answer 6 years, 8 months and 9 days.
The formulas I use is as follow:
C4 =DATEDIF(DATE(C3;E3;F3);DATE(C2;E2;F2);"Y")
E4 =DATEDIF(DATE(C3;E3;F3);DATE(C2;E2;F2);"ym")
F4 =DATEDIF(DATE(C3;E3;F3);DATE(C2;E2;F2);"md")
Is there a way to figure out if my calculation is correct?
Clearly on 22 April 2019 they would be exactly 6 years 0 months 0 days.Also 22 December 2019 they would be exactly 6 years 8 months 0 days. Starting from there:
Based on inspection the value of 10 days appears correct.
I have a list of E-mail addresses and order dates. I am trying to figure out how to display the number of customers that order every week, twice a month, once a month, once every 2 months, once every 3 months, once every 4 months, and once every 5 months or more.
What is the best way to accomplish this is? I have 400K records.
I'd suggest a pivot table that counts dates by e-address. With say 12 months of data Count of date = 6 is once every 2 months (on average!) =12 is once every month. That does not deal with an e-address that ordered 4 times in the last month of the year but I am not sure that is your requirement because if ordered on the last day of the year the frequency could be any of your options.