Hi,
Try
=AVERAGE(SMALL(A1:A10,ROW(INDIRECT("1:"&B1))))
Where you enter the x in B1.
If you want x and xx to be variables then
=AVERAGE(SMALL(INDIRECT("A1:A"&B1),ROW(INDIRECT("1:"&B2))))
where B1 tells how many row starting in A1 and B2 tell how many items to be
averaged.
If this helps, please click the Yes button.
Cheers,
Shane Devenshire