View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bill Billmire Bill Billmire is offline
external usenet poster
 
Posts: 2
Default Evaluate a range of cells for true or false condition (Div/0)

I want to check a range of cells for an all zero condition to preclude a
divide by zero error. If any of the cells (in the range) contain non-zero
data then proceed with the remaining calculation. If all the cells (in the
range) are zeros, then stop and optionally present either a meaning full
message (my composition) or just leave blank ("").

=IF(logical_test,SUMIF(B1:B20,"E",A1:A20)/COUNTIF(B1:B20,"E"),"")
--
Bill Billmire