View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gil D. Gil D. is offline
external usenet poster
 
Posts: 15
Default SumProduct problem

Hello,

I wrote a function which is using SumProduct.

a is a worksheet range
b is a worksheet cell
c is a worksheet range

Function cond_average(a, b, c)

If Application.SumProduct(--(a = b), --(c < "")) = 0 Then
cond_average = -1
Else
cond_average = Application.SumIf(a, b, c) / Application.CountIf(a,
b)
End If

End Function

Sumif and CountIf functions works but SumProduct returns error.

What is wrong ?

thank you
Gil D.