![]() |
|
#1
|
|||
|
|||
![]()
Good morning all,
I am looking to find the highest 30 day average of sales within a 180 range. I already track total sales by month, but as an example, this doesn't work as an accurate depiction. Example: first half of Aug sales were low, second half were high; first half of September sales were high, and the second were low. The period from mid august to mid September was the highest sales period. any clue how to find this info? thanks in advance. -Mike |
#2
|
||||
|
||||
![]()
Please post a sample sheet with some data and expected results - Thx
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#3
|
|||
|
|||
![]()
Peco,
Thanks. Please see attached example. Highlighted cell represents the desired result. I want this to be an automated so that I can determine worst case scenario for demand of an item. Initially, I had thought that using =average(Large(range{1,2,3,4,5,...30})) would do the trick, but that will give me the average of the 30 highest days of sales, not the highest 30 days of sales....make sense? -Mike |
#4
|
|||
|
|||
![]()
I can see only 2 possible solutions:
1. A VBA script which reads 180 days data into array, and runs a 150-step cycle, calculates an average (there is a shortcut when you save before the first value in cycle, so you can deduce it in next cycle and add a new last value instead) for every step, and when this is more than max average until this step, saves the new max value into variable(s) or another array (probably you need period start and end dates too), or into predefined Name; 2. A separate table with columns PeriodStart and PeriodEnd which are calculated for first row as (TODAY() - 180 +ROW() - X) AND (TODAY() - 180 + ROW() - X) + 30, where X is the number of row for 1st period. For every next row, the period shifts 1 day, and you'll have 150 rows of data in this table. In 3rd column, average for period is calculated from your data table (Using SUMIFS() formulas). And then you can calculate max average using MAX() function on column with averages (calculate it as Name - then it will be much easier to use it in formulas). |
#5
|
|||
|
|||
![]()
I am not sure, but you can try to take a look at row 14 in the attached file.
Cell B14 shows the average sales for first 30 days, cell C14 shows average sales for 02-jan-17 to 31-jan-17 and so on. |
#6
|
||||
|
||||
![]() Quote:
![]()
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#7
|
|||
|
|||
![]()
My version how to do it
|
#8
|
|||
|
|||
![]() I apologize, but cannot open the zip file on my computer. Any chance in attaching the file direct? |
#9
|
|||
|
|||
![]()
OK, it looks like our firewall let it through!
Btw, 7Zip is free, and allows to pack and unpack various formats. Last edited by ArviLaanemets; 10-02-2017 at 07:23 AM. Reason: Edit |
#10
|
|||
|
|||
![]()
If start date is 1/1/17 formula is
=LARGE((SUMIF(OFFSET($B$2,0,ROW($1:$180)-ROW($1:$1),1,30),">0")/30),1) ARRAY formula is used To enter ARRAY formula Paste the formula Press F2 Press Ctrl+Shift+Enter keys together. formula will be covered with{} brackets by excel. |
#11
|
||||
|
||||
![]()
Non-array formula:
=MAX(INDEX(SUBTOTAL(1,(OFFSET($B$2,0,COLUMN($B$2:$ AE$2)-2,1,30))),)) |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
FUGMAN | Excel Programming | 7 | 02-05-2017 08:37 AM |
average formal if cell contains number and text | Michael Labuschagne | Excel | 2 | 12-08-2016 06:35 AM |
![]() |
rick10r | Excel | 1 | 07-05-2016 12:07 PM |
Filling the consecutive cell by day. | aligahk06 | Excel | 1 | 09-15-2010 08:17 AM |
calculate average depending on drop-down values | virencm | Word | 0 | 08-06-2010 06:10 PM |