How can I fix this formula so if none of the 5 cells in the range have a number value this formula doesnt give an error but displays a - instead. The 5 cells show a - when no value is them. J21 is the formula I am having the problem with
Excel 2013
<tbody>
[TD="align: center"]20[/TD]
[TD="bgcolor: #D9D9D9, align: center"][/TD]
[TD="bgcolor: #FFFFFF, align: center"][/TD]
[TD="bgcolor: #D9D9D9, align: center"][/TD]
[TD="bgcolor: #FFFFFF, align: center"][/TD]
[TD="bgcolor: #D9D9D9, align: center"][/TD]
[TD="align: center"]Grade[/TD]
[TD="align: right"][/TD]
[TD="align: center"]21[/TD]
[TD="bgcolor: #D9D9D9, align: center"]-[/TD]
[TD="align: center"]-[/TD]
[TD="bgcolor: #D9D9D9, align: center"]87.00[/TD]
[TD="align: center"]-[/TD]
[TD="bgcolor: #D9D9D9, align: center"]-[/TD]
[TD="bgcolor: #548235, align: center"]87.00[/TD]
[TD="bgcolor: #548235, align: center"]A[/TD]
</tbody>
[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E21[/TH]
[TD="align: left"]=IF(COUNT(E3:E20),AVERAGE(E3:E20),"-")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]F21[/TH]
[TD="align: left"]=IF(COUNT(F3:F20),AVERAGE(F3:F20),"-")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]G21[/TH]
[TD="align: left"]=IF(COUNT(G3:G20),AVERAGE(G3:G20),"-")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]H21[/TH]
[TD="align: left"]=IF(COUNT(H3:H20),AVERAGE(H3:H20),"-")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]I21[/TH]
[TD="align: left"]=IF(COUNT(I3:I19),AVERAGE(I3:I20),"-")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]K21[/TH]
[TD="align: left"]=LOOKUP(J21,AG1:AG18,AH1:AH18)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]J21[/TH]
[TD="align: left"]{=SUMPRODUCT(AE3:AE7,AF3:AF7)/SUM(IF(AF3:AF7<>"-",AE3:AE7))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
Excel 2013
E | F | G | H | I | J | K | |
---|---|---|---|---|---|---|---|
<tbody>
[TD="align: center"]20[/TD]
[TD="bgcolor: #D9D9D9, align: center"][/TD]
[TD="bgcolor: #FFFFFF, align: center"][/TD]
[TD="bgcolor: #D9D9D9, align: center"][/TD]
[TD="bgcolor: #FFFFFF, align: center"][/TD]
[TD="bgcolor: #D9D9D9, align: center"][/TD]
[TD="align: center"]Grade[/TD]
[TD="align: right"][/TD]
[TD="align: center"]21[/TD]
[TD="bgcolor: #D9D9D9, align: center"]-[/TD]
[TD="align: center"]-[/TD]
[TD="bgcolor: #D9D9D9, align: center"]87.00[/TD]
[TD="align: center"]-[/TD]
[TD="bgcolor: #D9D9D9, align: center"]-[/TD]
[TD="bgcolor: #548235, align: center"]87.00[/TD]
[TD="bgcolor: #548235, align: center"]A[/TD]
</tbody>
[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E21[/TH]
[TD="align: left"]=IF(COUNT(E3:E20),AVERAGE(E3:E20),"-")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]F21[/TH]
[TD="align: left"]=IF(COUNT(F3:F20),AVERAGE(F3:F20),"-")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]G21[/TH]
[TD="align: left"]=IF(COUNT(G3:G20),AVERAGE(G3:G20),"-")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]H21[/TH]
[TD="align: left"]=IF(COUNT(H3:H20),AVERAGE(H3:H20),"-")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]I21[/TH]
[TD="align: left"]=IF(COUNT(I3:I19),AVERAGE(I3:I20),"-")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]K21[/TH]
[TD="align: left"]=LOOKUP(J21,AG1:AG18,AH1:AH18)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]J21[/TH]
[TD="align: left"]{=SUMPRODUCT(AE3:AE7,AF3:AF7)/SUM(IF(AF3:AF7<>"-",AE3:AE7))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
Last edited: