Work sheet function -average

  • Thread starter Thread starter SUNIL
  • Start date Start date
S

SUNIL

Hi ,please help a newbie.
I need the average of cells A1:A5 in A6 , but some cells may be blank.
Please explain if you can. Thanks

Sunil
 
Sunil
the Average function would be
=average(A1:A5) or in vba myAve = WorksheetFunction.Average(Range("A1:A5"))
to get the average ignoring blanks try
=sum(A1:A5)/counta(A1:A5)
or
myAve =
WorksheetFunction.Sum(Range("A1:A5"))/WorksheetFunction.CountA(Range("A1:A5"
))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top