View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Billy Liddel Billy Liddel is offline
external usenet poster
 
Posts: 527
Default how can I ignore or hide the #N/A when doing a sum or subtotal?

"Jules73" wrote:

I have a list of products on drop downs (validation) which also populates a
cell next to it with its base cost. However if nothing is selected it shows
as #N/A. At the bottom of the list is a subtotal which works if it only looks
at cells with numbers. If it see an #N/A it doesnt total the ones that have
been populated. How can I get the subtotal to ignore blanks or #N/A? How do I
get it to show Blanks in stead of #N/A for that matter?


Jules
I'm not sure if this will do but this UDF will ignore errors and sum the range

Function SumErrRange(range) As Double
Dim c, myTotal As Double
For Each c In range
If IsNumeric(c) Then
myTotal = myTotal + c
End If
Next
SumErr = myTotal
End Function

Hope this works for you
Peter