LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA AVERAGE formula, ignoring zeros

I have the following code:


'Average applicable cells ignoring zeros
Worksheets("Summary").Range("H5").Formula = "=Average('" &
startsheet & ":" & endsheet & "'!H5)"


The problem is that the formula as written includes zeros in the
average. I need to ignore zeros.

Some background:

This is only a portion of a subroutine

The routine then goes on to copy the newly writtem formula (note the
relative fererence) to other selected cells on the sheet "Summary"

The "startsheet" and "endsheet" strings used in the formula can change
depending on which sheets are specified by the user so I need to keep
this logic

Can anyone help we with a formula to average the range specified,
ignoring zeros?


---
Message posted from http://www.ExcelForum.com/

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Average formula where blank cells are counted as zeros krwelling Excel Worksheet Functions 5 May 20th 23 11:43 AM
Average from three different coworkers excluding zeros formula? Rhett C[_2_] Excel Discussion (Misc queries) 3 November 1st 08 09:58 PM
Average ignoring Zeros Gary Excel Worksheet Functions 3 February 21st 07 02:20 AM
Averaging, ignoring zeros Mark Excel Worksheet Functions 5 February 28th 05 10:25 PM
Formula to average ignoring negatives? Steve Excel Discussion (Misc queries) 16 January 1st 05 12:57 PM


All times are GMT +1. The time now is 02:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"