Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Special average calculation

Hi
I would like to calculate the average of a list of numbers such as
45, 56e, 67, 32.
The e in 56e is important because it indicates an estimated score.

I could write a macro to strip the e away first, but I was wondering if
there was a simpler way to handle this, such as a VBA function or a
worksheet function ?

=AverageA doesn't seem to do it.

TIA

Andrew
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Special average calculation

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

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

--
---
HTH

Bob


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



"Andrew Bourke" wrote in message
...
Hi
I would like to calculate the average of a list of numbers such as
45, 56e, 67, 32.
The e in 56e is important because it indicates an estimated score.

I could write a macro to strip the e away first, but I was wondering if
there was a simpler way to handle this, such as a VBA function or a
worksheet function ?

=AverageA doesn't seem to do it.

TIA

Andrew



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Special average calculation

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
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 Calculation Munchkin Excel Worksheet Functions 4 September 4th 09 07:12 PM
Average IF with calculation Chris Excel Worksheet Functions 2 February 16th 08 12:40 AM
use sub-totals and average in same calculation Sherry L Excel Worksheet Functions 0 January 26th 08 06:56 PM
average calculation blackstar Excel Discussion (Misc queries) 1 February 4th 06 07:46 PM
Average Calculation smallcap Excel Worksheet Functions 6 October 28th 05 12:36 AM


All times are GMT +1. The time now is 07:39 PM.

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

About Us

"It's about Microsoft Excel"