Probably simple, but getting a "#VALUE!" error please help

Chace

New member
Joined
Mar 24, 2015
Messages
2
Reaction score
0
Points
0
I am getting a #VALUE! when trying to compute this formula

=IF(B10="1",AVERAGE(C204:C207)),IF(B10="2",AVERAGE(C208:C211)),IF(B10="3",AVERAGE(C212:C215)),IF(B10="4",AVERAGE(C216:C219)),IF(B10="5",AVERAGE(C220:C223)),IF(B10="6",AVERAGE(C224:C227)),IF(B10="7",AVERAGE(C228:C231)),IF(B10="8",AVERAGE(C232:C235)),IF(B10="9",AVERAGE(C236:C239)),IF(B10="10",AVERAGE(C240:C243)),IF(B10="11",AVERAGE(C244:C247)),IF(B10="12",AVERAGE(C248:C251))

What am I doing wrong? I am trying to make it so when I change the number in cell B10 it changes the cells that it is averaging. Maybe I am trying to do the wrong formula?? Please help me.

Thank you everyone in advance!

--Chace
 
Try:
=IF(B10=1,AVERAGE(C204:C207),IF(B10=2,AVERAGE(C208:C211),IF(B10=3,AVERAGE(C212:C215),IF(B10=4,AVERAGE(C216:C219),IF(B10=5,AVERAGE(C220:C223),IF(B10=6,AVERAGE(C224:C227),IF(B10=7,AVERAGE(C228:C231),IF(B10=8,AVERAGE(C232:C235),IF(B10=9,AVERAGE(C236:C239),IF(B10=10,AVERAGE(C240:C243),IF(B10=11,AVERAGE(C244:C247),IF(B10=12,AVERAGE(C248:C251)))))))))))))
 
Perhaps we could make this much shorter
Code:
 =(B10=1)*AVERAGE(C204:C207)+(B10>1)*average(index($C$204:$C$251,,4*(B10-1)):index($C$204:$C$251,,4*B10)
 
That worked Sambit, thank you so much you solved all of my life problems!! :) :) :)
 
Last edited:
Back
Top