View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Special average calculation

As an array formula you need to evaluate it, like so

Range("A1").Value =
Activesheet.Evaluate("=SUM(IF(A1:A10<"""",--SUBSTITUTE(A1:A10,""e"","""")))")


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Andrew Bourke" wrote in message
...
Very nice.
Can this be put easily into a VBA macro ?
Rather than leave formulas in cells on the sheet I would like to do the
calculations through a macro.

TIA
Andrew

Bob Phillips wrote:
=SUM(IF(A1:A10<"",--SUBSTITUTE(A1:A10,"e","")))

this is an array formula, so commit with Ctrl-Shift-Enter