How can I fix my #DIV/0 outcome?

artful

New Member
Joined
Oct 21, 2006
Messages
3
I am calculating averages but get a nasty #DIV/0 outcome when part of my array is ZERO.

my forumla is: {=AVERAGE(IF(LEFT($W$3:$W$459,4)=J$462,IF($F$3:$F$459=$H464,IF($J$3:$J$459>0,$J$3:$J$459))))}

Can anyone suggest a solution?
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
One way would be to use

=SUMPRODUCT(--(LEFT($W$3:$W$459,4)=J$462),--($F$3:$F$459=$H464),--($J$3:$J$459>0),$J$3:$J$459)/MAX(1,SUMPRODUCT(--(LEFT($W$3:$W$459,4)=J$462),--($F$3:$F$459=$H464),--($J$3:$J$459>0)))
 
Upvote 0
Also...

{=LOOKUP(9.99999999999999E+307,CHOOSE{1,2},0,AVERAGE(IF(LEFT($W$3:$W$459,4)=J$462,IF($F$3:$F$459=$H464,IF($J$3:$J$459>0,$J$3:$J$459))))))}
 
Upvote 0
Thanks for your answers guys. really appreciate it.

I was able to use Barry's answer :biggrin:
but I couldn't get Aladin's to work (came up with a error in formula 'CHOOSE').
 
Upvote 0
Thanks for your answers guys. really appreciate it.

I was able to use Barry's answer :biggrin:
but I couldn't get Aladin's to work (came up with a error in formula 'CHOOSE').

Probably because of a missing paren...

{=LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,AVERAGE(IF(LEFT($W$3:$W$459,4)=J$462,IF($F$3:$F$459=$H464,IF($J$3:$J$459>0,$J$3:$J$459)))))}
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

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