need to calculate the average of the first ten real results in a series of 30 numbers - some will be blank

sfinns

New Member
Joined
Jan 23, 2012
Messages
12
I need to calculate the average of the first ten real results in a series of 30 numbers - some will be blank.. the first ten in the series from left to right and ignore any numbers post teh first ten results taht appear - there will be several blanks in the series and multiple series with lots of blanks. If there are not ten signalled numbers in the series then the average of what is there ,ie 8 /9 etc.

itemresult?
1​
2​
3​
4​
5​
6​
7​
8​
9​
10​
11​
12​
13​
14​
15​
16​
17​
18​
19​
20​
21​
22​
23​
24​
25​
26​
27​
28​
29​
30​
figures
1.8%​
16.0%​
8.3%​
1.4%​
-2.2%​
13.2%​
-11.7%​
3.9%​
10.4%​
19.5%​
-13.1%​
4.1%​
6.5%​
-8.2%​
23.0%​
9.8%​
4.2%​
14.9%​
5.9%​
7.8%​
1.2%​
1.3%​
6.9%​
figures
5.9%​
20.1%​
-3.8%​
-0.1%​
24.1%​
3.8%​
13.4%​
12.6%​
82.3%​
4.9%​
10.4%​
8.0%​
0.0%​
1.6%​
5.5%​
22.7%​
22.9%​
-3.6%​
9.5%​
average of first ten results that arent blank?
if less than ten then whatever the number
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Maybe...

Pasta1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1itemResult123456789101112131415161718192021222324252627282930
2figures6,1%1,8%16,0%8,3%1,4%-2,2%13,2%-11,7%3,9%10,4%19,5%-13,1%4,1%6,5%-8,2%23,0%9,8%4,2%14,9%5,9%7,8%1,2%1,3%6,9%
3figures17,7%5,9%20,1%-0,1%24,1%3,8%13,4%12,6%82,3%4,9%10,4%8,0%0,0%1,6%5,5%22,7%22,9%-3,6%9,5%
Plan1
Cell Formulas
RangeFormula
B2:B3B2=AVERAGE(D2:INDEX(D2:AG2,MATCH(10,INDEX(SUBTOTAL(2,OFFSET(D2,,,1,COLUMN(D2:AG2)-COLUMN(D2)+1)),),1)))


Hope this helps

M.
 
Upvote 0
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version.

If you have Excel 365 with the new dynamic array functions then you can try the column C formula below.
Failing that I have suggested in column B a modification to Marcelo's formula to account for ..
If there are not ten signalled numbers in the series then the average of what is there ,ie 8 /9 etc.

20 03 06.xlsm
BCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1ResultResult123456789101112131415161718192021222324252627282930
26.1%6.1%1.8%16.0%8.3%1.4%-2.2%13.2%-11.7%3.9%10.4%19.5%-13.1%4.1%6.5%-8.2%23.0%9.8%4.2%14.9%5.9%7.8%1.2%1.3%6.9%
317.7%17.7%5.9%20.1%-0.1%24.1%3.8%13.4%12.6%82.3%4.9%10.4%8.0%0.0%1.6%5.5%22.7%22.9%-3.6%9.5%
44.7%4.7%3.20%6.20%
Average First 10
Cell Formulas
RangeFormula
B2:B4B2=AVERAGE(D2:INDEX(D2:AG2,MATCH(MIN(10,COUNT(D2:AG2)),INDEX(SUBTOTAL(2,OFFSET(D2,,,1,COLUMN(D2:AG2)-COLUMN(D2)+1)),),0)))
C2:C4C2=AVERAGE(INDEX(FILTER(D2:AG2,D2:AG2<>""),SEQUENCE(,MIN(10,COUNT(D2:AG2)))))
 
Upvote 0
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version.

If you have Excel 365 with the new dynamic array functions then you can try the column C formula below.
Failing that I have suggested in column B a modification to Marcelo's formula to account for ..

If there are not ten signalled numbers in the series then the average of what is there ,ie 8 /9 etc.

Peter,

My formula works with less than 10 numbers... :)

Pasta1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1itemResult123456789101112131415161718192021222324252627282930
2figures6,1%1,8%16,0%8,3%1,4%-2,2%13,2%-11,7%3,9%10,4%19,5%-13,1%4,1%6,5%-8,2%23,0%9,8%4,2%14,9%5,9%7,8%1,2%1,3%6,9%
3figures17,7%5,9%20,1%-0,1%24,1%3,8%13,4%12,6%82,3%4,9%10,4%8,0%0,0%1,6%5,5%22,7%22,9%-3,6%9,5%
4figures4,7%3,2%6,2%
Plan2
Cell Formulas
RangeFormula
B2:B4B2=AVERAGE(D2:INDEX(D2:AG2,MATCH(10,INDEX(SUBTOTAL(2,OFFSET(D2,,,1,COLUMN(D2:AG2)-COLUMN(D2)+1)),),1)))


Observe the 1

M.
 
Upvote 0
Complementing the previous post

In fact, with less than 10 numbers the formula calculates the Average of the entire row (30 cells), but as blank cells are not taken into account by the AVERAGE function everything works fine ;).

M.
 
Upvote 0
Peter,

My formula works with less than 10 numbers... :)

Observe the 1

M.
Hi Marcelo
Looking again at your formula it should and does work. Sorry for suggesting otherwise. :oops:

The reason that I thought it didn't is that when I copied your XL2BB sheet to mine, that final "1" gets changed to a 0 & I hadn't noticed that happen
I have no idea why that happens. Can you check what happens at your end if you 'Copy to clipboard' from your post to a fresh sheet? Might have to report an "issue".
Doesn't look like it should be language translation related but I guess that could have something to do with it
 
Upvote 0
Hi Marcelo
Looking again at your formula it should and does work. Sorry for suggesting otherwise. :oops:

The reason that I thought it didn't is that when I copied your XL2BB sheet to mine, that final "1" gets changed to a 0 & I hadn't noticed that happen
I have no idea why that happens. Can you check what happens at your end if you 'Copy to clipboard' from your post to a fresh sheet? Might have to report an "issue".
Doesn't look like it should be language translation related but I guess that could have something to do with it


It's not your fault.
I edited the formula 1 minute after I've posted it.
Sorry for not mentioned it :oops:

M.
 
Upvote 0
It's not your fault.
I edited the formula 1 minute after I've posted it.
Ah, but it looks like you only edited it in the formula box below the sheet. If you hover over cell B2 in post #2 you will see that it still has a 0 at the end. It is those actual formulas in the cells that get copied when using 'Copy to clipboard'. If you edit a formula you really need to do it in your worksheet and re-generate the XL2BB code. :)
 
Upvote 0
Ah, but it looks like you only edited it in the formula box below the sheet. If you hover over cell B2 in post #2 you will see that it still has a 0 at the end. It is those actual formulas in the cells that get copied when using 'Copy to clipboard'. If you edit a formula you really need to do it in your worksheet and re-generate the XL2BB code. :)

Peter,

Thank you for pointing out

Yes, i edited directly the BB code generated by XL2BB and forgot to edit the formulas in B2:B3

To all: please, disregard post #2

Correct version...
Pasta1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1itemResult123456789101112131415161718192021222324252627282930
2figures6,1%1,8%16,0%8,3%1,4%-2,2%13,2%-11,7%3,9%10,4%19,5%-13,1%4,1%6,5%-8,2%23,0%9,8%4,2%14,9%5,9%7,8%1,2%1,3%6,9%
3figures17,7%5,9%20,1%-0,1%24,1%3,8%13,4%12,6%82,3%4,9%10,4%8,0%0,0%1,6%5,5%22,7%22,9%-3,6%9,5%
4figures4,7%3,2%6,2%
Plan2
Cell Formulas
RangeFormula
B2:B4B2=AVERAGE(D2:INDEX(D2:AG2,MATCH(10,INDEX(SUBTOTAL(2,OFFSET(D2,,,1,COLUMN(D2:AG2)-COLUMN(D2)+1)),),1)))


M.
 
Upvote 0
Peter,

Thank you for pointing out

Yes, i edited directly the BB code generated by XL2BB and forgot to edit the formulas in B2:B3
No problem - at least we got to the bottom of it (& no re-write for XL2BB needed) :)


If dynamic array functions are not available, a further option without the volatile function OFFSET would be

20 03 06.xlsm
BCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1Result123456789101112131415161718192021222324252627282930
26.1%1.8%16.0%8.3%1.4%-2.2%13.2%-11.7%3.9%10.4%19.5%-13.1%4.1%6.5%-8.2%23.0%9.8%4.2%14.9%5.9%7.8%1.2%1.3%6.9%
317.7%5.9%20.1%-0.1%24.1%3.8%13.4%12.6%82.3%4.9%10.4%8.0%0.0%1.6%5.5%22.7%22.9%-3.6%9.5%
44.7%3.20%6.20%
Average First 10 (2)
Cell Formulas
RangeFormula
B2:B4B2=AVERAGE(D2:INDEX(D2:AG2,AGGREGATE(15,6,(COLUMN(D2:AG2)-COLUMN(D2)+1)/(D2:AG2<>""),MIN(10,COUNT(D2:AG2)))))
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top