Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default Calculation of weighed average

I have a number of cells in a row, D3:K3 (actually the row will
contain columns up to FZ). These cells can either contain a number o4r
be empty. An example could be

D E F G H I J K
2 4 7 2 - 2 - 7

The "-" indicates an empty cell.

Now what I need is a formula, that takes the sum of all the cells and
multiply the sum by by 2 (the easy part :-)), and divides it with the
number of cells, multiplied by two, if the cell is not empty and
multiplied by 1 if the cell isempty.

In the above example the multiplied by 2 sum is 48. And this should be
divided by 14 as there are 6 values (mulitplied by two) and two empty
cells. COUNT will count the cells with content

Jan
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default Calculation of weighed average

Sorry for the trouble. It just came to me :-(

SUM(D3:K3)*2/(COUNT(D3:K3)*2+COUNTBLANK(D3:K3))

Jan
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Calculation of weighed average

Try this formula...

=SUMPRODUCT((D1:K1)*(2-(D1:K1="")))

--
Rick (MVP - Excel)



"jkrons" wrote in message
...
I have a number of cells in a row, D3:K3 (actually the row will
contain columns up to FZ). These cells can either contain a number o4r
be empty. An example could be

D E F G H I J K
2 4 7 2 - 2 - 7

The "-" indicates an empty cell.

Now what I need is a formula, that takes the sum of all the cells and
multiply the sum by by 2 (the easy part :-)), and divides it with the
number of cells, multiplied by two, if the cell is not empty and
multiplied by 1 if the cell isempty.

In the above example the multiplied by 2 sum is 48. And this should be
divided by 14 as there are 6 values (mulitplied by two) and two empty
cells. COUNT will count the cells with content

Jan


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Calculation of weighed average

=2*SUM($D$1:$K$1)/SUM(IF(ISBLANK($D$1:$K$1),1,2))

CTRL+SHIFT+ENTER this formula as this is an array-formula

pls click YES if this helped



On 9 Kwi, 09:45, jkrons wrote:
I have a number of cells in a row, D3:K3 (actually the row will
contain columns up to FZ). These cells can either contain a number o4r
be empty. An example could be

D *E *F *G *H *I *J *K
2 *4 * 7 * 2 *- * 2 *- *7

The "-" indicates an empty cell.

Now what I need is a formula, that takes the sum of all the cells and
multiply the sum by by 2 (the easy part :-)), and divides it with the
number of cells, multiplied by two, if the cell is not empty and
multiplied by 1 if the cell isempty.

In the above example the multiplied by 2 sum is 48. And this should be
divided by 14 as there are 6 values (mulitplied by two) and two empty
cells. COUNT will count the cells with content

Jan


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Calculation of weighed average

cute

I like that one

;-)


On 9 Kwi, 09:52, "Rick Rothstein"
wrote:
Try this formula...

=SUMPRODUCT((D1:K1)*(2-(D1:K1="")))

--
Rick (MVP - Excel)

"jkrons" wrote in message

...



I have a number of cells in a row, D3:K3 (actually the row will
contain columns up to FZ). These cells can either contain a number o4r
be empty. An example could be


D *E *F *G *H *I *J *K
2 *4 * 7 * 2 *- * 2 *- *7


The "-" indicates an empty cell.


Now what I need is a formula, that takes the sum of all the cells and
multiply the sum by by 2 (the easy part :-)), and divides it with the
number of cells, multiplied by two, if the cell is not empty and
multiplied by 1 if the cell isempty.


In the above example the multiplied by 2 sum is 48. And this should be
divided by 14 as there are 6 values (mulitplied by two) and two empty
cells. COUNT will count the cells with content


Jan- Ukryj cytowany tekst -


- Poka¿ cytowany tekst -




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Calculation of weighed average

I'm glad you liked it. We can actually shorten it by two character by
removing the one unnecessary set of parentheses...

=SUMPRODUCT(D1:K1*(2-(D1:K1="")))

And, if you don't mind array-entered** formulas, we can save another 7
characters using this array-entered** formula...

=SUM(D1:K1*(2-(D1:K1="")))

**commit formula using Ctrl+Shift+Enter and not Enter by itself

--
Rick (MVP - Excel)



"Jarek Kujawa" wrote in message
...
cute

I like that one

;-)


On 9 Kwi, 09:52, "Rick Rothstein"
wrote:
Try this formula...

=SUMPRODUCT((D1:K1)*(2-(D1:K1="")))

--
Rick (MVP - Excel)

"jkrons" wrote in message

...



I have a number of cells in a row, D3:K3 (actually the row will
contain columns up to FZ). These cells can either contain a number o4r
be empty. An example could be


D E F G H I J K
2 4 7 2 - 2 - 7


The "-" indicates an empty cell.


Now what I need is a formula, that takes the sum of all the cells and
multiply the sum by by 2 (the easy part :-)), and divides it with the
number of cells, multiplied by two, if the cell is not empty and
multiplied by 1 if the cell isempty.


In the above example the multiplied by 2 sum is 48. And this should be
divided by 14 as there are 6 values (mulitplied by two) and two empty
cells. COUNT will count the cells with content


Jan- Ukryj cytowany tekst -


- Poka¿ cytowany tekst -


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Calculation of weighed average

I definitely don't, Rick

;-)

On 9 Kwi, 10:19, "Rick Rothstein"
wrote:
I'm glad you liked it. We can actually shorten it by two character by
removing the one unnecessary set of parentheses...

=SUMPRODUCT(D1:K1*(2-(D1:K1="")))

And, if you don't mind array-entered** formulas, we can save another 7
characters using this array-entered** formula...

=SUM(D1:K1*(2-(D1:K1="")))

**commit formula using Ctrl+Shift+Enter and not Enter by itself

--
Rick (MVP - Excel)

"Jarek Kujawa" wrote in message

...



cute


I like that one


;-)


On 9 Kwi, 09:52, "Rick Rothstein"
wrote:
Try this formula...


=SUMPRODUCT((D1:K1)*(2-(D1:K1="")))


--
Rick (MVP - Excel)


"jkrons" wrote in message


....


I have a number of cells in a row, D3:K3 (actually the row will
contain columns up to FZ). These cells can either contain a number o4r
be empty. An example could be


D Â*E Â*F Â*G Â*H Â*I Â*J Â*K
2 Â*4 Â* 7 Â* 2 Â*- Â* 2 Â*- Â*7


The "-" indicates an empty cell.


Now what I need is a formula, that takes the sum of all the cells and
multiply the sum by by 2 (the easy part :-)), and divides it with the
number of cells, multiplied by two, if the cell is not empty and
multiplied by 1 if the cell isempty.


In the above example the multiplied by 2 sum is 48. And this should be
divided by 14 as there are 6 values (mulitplied by two) and two empty
cells. COUNT will count the cells with content


Jan- Ukryj cytowany tekst -


- Poka¿ cytowany tekst -- Ukryj cytowany tekst -


- Pokaż cytowany tekst -


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 IF with calculation Chris Excel Worksheet Functions 2 February 16th 08 12:40 AM
Weighed Average 0-0 Wai Wai ^-^ Excel Worksheet Functions 3 December 7th 05 02:58 PM
Average Calculation smallcap Excel Worksheet Functions 6 October 28th 05 12:36 AM
Weighed Average of a weiged average when there are blanks krl - ExcelForums.com Excel Discussion (Misc queries) 1 July 6th 05 07:37 PM
Weighed average if the adjecent column contains blanks Kasimir Lehväsl Excel Discussion (Misc queries) 2 July 4th 05 10:12 PM


All times are GMT +1. The time now is 07:26 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"