ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Mod a Formula For Errors (https://www.excelbanter.com/excel-worksheet-functions/155389-mod-formula-errors.html)

Carl

Mod a Formula For Errors
 
I'm trying to modify this formula so that it does the calculation even if
some of the cells in the ranges do not have "values (N/A or other errors).
Thanks you in advance.

=SUMPRODUCT(--($C$3:$C$216=I3);--($F$3:$F$2160))/COUNTIF($C$3:$C$216;I3)

Michael

Mod a Formula For Errors
 
You can force it to be zero with an if statement like so:

=IF(ISERROR(SUMPRODUCT(--($C$3:$C$216=I3)--($F$3:$F$2160))/COUNTIF($C$3:$C$216,I3)),0,SUMPRODUCT(--($C$3:$C$216=I3)--($F$3:$F$2160))/COUNTIF($C$3:$C$216,I3))


--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"carl" wrote:

I'm trying to modify this formula so that it does the calculation even if
some of the cells in the ranges do not have "values (N/A or other errors).
Thanks you in advance.

=SUMPRODUCT(--($C$3:$C$216=I3);--($F$3:$F$2160))/COUNTIF($C$3:$C$216;I3)



All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com