jamescooper

Well-known Member
Joined
Sep 8, 2014
Messages
834
Hello,
I have the following formula which takes the average of the first 5 values of a column, how would I add in so it ensures column A2:A5000 = 1, or 2, or 3, too?

=AVERAGE(IF(ROW(P2:P5000<=SMALL(IF(P2:P5000<>"",ROW(P2:P5000)),MIN(COUNT(P2:P5000),5)),IF(P2:P5000<>"",P2:P5000)))

Many thanks.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Control+shuft+enter:

1.

=AVERAGE(IF(ROW(P2:P5000)<=SMALL(IF(ISNUMBER(P2:P5000),ROW(P2:P5000)),MIN(COUNT(P2:P5000),5)),IF(ISNUMBER(P2:P5000),P2:P5000)))

2.

=AVERAGE(IF(ROW(P2:P5000)<=SMALL(IF(ISNUMBER(P2:P5000),IF(A2:A5000=1,ROW(P2:P5000))),MIN(SUM(IF(A2:A5000=1,IF(ISNUMBER(P2:P5000),1))),5)),IF(A2:A5000=1,IF(ISNUMBER(P2:P5000),P2:P5000))))
 
Upvote 0

Forum statistics

Threads
1,217,346
Messages
6,136,042
Members
449,981
Latest member
kjd513

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