Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Help - I've tried all kinds of things but no luck.

Howdy,

Thanks for taking the time to read my post. I'm having problems creating a
custom function in VBA (I'm not an experienced user)

Basically i have a huge data sheet with just 6 columns but 60,000 rows. Each
of the 6 cells in a row have values (0-10). I need the average of the value
in each row, however if one (or more) of the cells contains 0, i need to do a
weighted average - in other words if the figures are 1,4,6,0,4,5 then instead
of adding and dividing by 6 i'd add and divide by 5 and then i need excel to
multiply by 6/5 - to weight it for a '6' cell average.

Another example if its 3,4,0,0,5,6

then need it to sum them and divide by 4 then multiply by 6/4

In maths terms its

(a+b+c+d+e+f / N) X 6/N

Any ideas - you'd helping in some medical research!!
--
simon
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Help - I've tried all kinds of things but no luck.

On May 21, 10:12*am, slfwalsh
wrote:
Howdy,

Thanks for taking the time to read my post. I'm having problems creating a
custom function in VBA (I'm not an experienced user)

Basically i have a huge data sheet with just 6 columns but 60,000 rows. Each
of the 6 cells in a row have values (0-10). I need the average of the value
in each row, however if one (or more) of the cells contains 0, i need to do a
weighted average - in other words if the figures are 1,4,6,0,4,5 then instead
of adding and dividing by 6 i'd add and divide by 5 and then *i need excel to
multiply by 6/5 - to weight it for a '6' cell average.

Another example *if its 3,4,0,0,5,6

then need it to sum them and divide by 4 then multiply by 6/4

In maths terms its

(a+b+c+d+e+f / N) X 6/N

Any ideas - you'd helping in some medical research!!
--
simon


The following formula should accomplish what you're wanting to do:

=(SUM(A1:F1)/COUNTIF(A1:F1,"0"))*(6/COUNTIF(A1:F1,"0"))

Hope this helps.
Jason
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
Combining 2 kinds of graphs [how?] gordom[_2_] Excel Discussion (Misc queries) 2 April 15th 09 08:01 PM
How to switch letters and numbers to other kinds? Israel Excel Discussion (Misc queries) 1 October 12th 06 04:40 PM
Different kinds of data on chart Michael J. Charts and Charting in Excel 4 August 8th 06 04:47 PM
Pushing my luck gb_S49 Excel Worksheet Functions 6 April 11th 05 06:01 PM
LUCK ? OZDOC1050 Excel Worksheet Functions 3 December 29th 04 01:13 PM


All times are GMT +1. The time now is 03:52 PM.

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"