Attach a workbook - we can't manipulate a picture.
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
NB: as a Moderator, I never accept friendship requests.
Forum Rules (updated August 2023): please read them here.
Sorry about that, I can't seem to find where to attach the file?
Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
Thanks for the info.
See attached.![]()
You can get rid of column C thus:
=SUM(B2:B4)/3
I am not sure what you want, though, when you say:
What will this look like? Are you wanting to have the highest average marked with Y without seeing the highest average column? If so, why? And also if so, why not just hide the column?Is it possible for an array formula to do the work of cells C,D,E ...
Excel 2016 (Windows) 32 bit
A B D 1 Series Amount Max Average 2 1 40 3 2 23 4 3 40 Y 5 4 50 6 5 65 7 6 30 8 7 10 9 8 20 10 9 23 11 10 40
Sheet: Sheet1
Last edited by AliGW; 09-09-2018 at 03:15 AM.
Yes, I could hide the column. It was more wanting to know if this was possible in an array.
If it is, I think it will be quite complex and possibly processor heavy, especially if your real dataset is large. As a theoretical question, it will be interesting to see if it can be done, but as a practical solution ...? Not so sure.
The difficulty will be combining a rolling average calculation with a fixed range maximum calculation.
Let's see if the array formula wizards here can crack it.
Last edited by AliGW; 09-09-2018 at 03:29 AM.
as a way
UDF
![]()
Please Login or Register to view this content.
Is this what you want?
=MAX(SUBTOTAL(1,OFFSET(B2,ROW(B2:B11)-ROW(B2),0,3,1)))
...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
That seems to work as a normal formula, Jason, without array-entering.
I think what the OP wants is for the formula to determine whether the row its' on is the one returning the maximum, and if so, return "Y".
PS Needs to be this, as the last two rows' results are not quite right with the formula in post #10:
=MAX(SUBTOTAL(9,OFFSET(B2,ROW(B2:B11)-ROW(B2),0,3,1))/3)
Last edited by AliGW; 09-09-2018 at 08:34 AM.
At a glance, it looks like it works without array confirming, but it only gets the average of B2:B5, none of the other ranges are evaluated.
But are the results correct, Ali?
The OP has asked for average of 3, but the last 2 results are false because there are less than 3 values to average.
This one gives the right result
=IF(SUM(B2:B5)/3=MAX(SUBTOTAL(9,OFFSET($B$2,ROW($B$2:$B$11)-ROW($B$2),0,3,1))/3),"Y","")
and this one gives the correct result.
=IF(SUM(B2:B5)/3=MAX(SUBTOTAL(1,OFFSET($B$2,ROW($B$2:$B$11)-ROW($B$2),0,3,1))),"Y","")
Regardless of which, array confirmation is needed before filling down.
I'm working to what the OP presented as the results he wants. Formulae from posts #10 and #11 below (neither array-entered):
Excel 2016 (Windows) 32 bit
A B C D E F 1 Series Amount Average of 3 Max Average Ali Jason 2 1 40 34.33333333 34.3333333 34.33333 3 2 23 37.66666667 37.6666667 37.66667 4 3 40 51.66666667 Y 51.6666667 51.66667 5 4 50 48.33333333 48.3333333 48.33333 6 5 65 35 35 35 7 6 30 20 20 20 8 7 10 17.66666667 17.6666667 17.66667 9 8 20 27.66666667 27.6666667 27.66667 10 9 23 21 21 31.5 11 10 40 13.33333333 13.3333333 40
Sheet: Sheet1
Originaly that was a single cell formula to give the max average without filling down. If you enter it and array confirm, this is what it gives you, 51.66666667
Now realising that they still want the Y flag column to highlight the row, I've modified the formula in post #12 to compare the average for each group of 3 to the average for all groups of 3 and fag the row that contains the max average without the other columns.
Enter either formula form post 12, in D2 and fill down (array confirmed, you get Y in the right place, not array confirmed, you don't).
Thanks Ali and Jason. I'd never thought out using Subtotal.
I've modified the range B2:B5 to B2:B4 in Jasons formula which returns the same result I was after.
Thanks Tim.
I presume you used the SUBTOTAL 9 option?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks