Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Andreea Moyes via OfficeKB.com
 
Posts: n/a
Default sumproduct function

Hi,

I have a function I'm trying to write and I don't know what I'm doing wrong.

I am trying to calculate a weighted average, but some of my metrics are
missing, so when they're missing, I'd like the average to adjust
automatically to include just the metrics I have numbers for.

Example

Weights 20 30 30 20 Function
Metric 10 10 10 10 (10*20+10*30+10*30+20*30)/100
Metric 10 5 (10*20+5*30)/50
Metric 10 10 (10*20+10*20)/40

Any idea how to achieve this?

Thanks for your help!!!!
Andreea

--
Message posted via http://www.officekb.com
  #2   Report Post  
Ken Wright
 
Posts: n/a
Default

=SUMPRODUCT(--$B$1:$E$1,--B2:E2)/SUMPRODUCT(--$B$1:$E$1,--ISNUMBER(B2:E2))

or

=SUMPRODUCT(--$B$1:$E$1,--B2:E2)/SUMPRODUCT(--$B$1:$E$1,--(B2:E2<""))

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"Andreea Moyes via OfficeKB.com" wrote in message
...
Hi,

I have a function I'm trying to write and I don't know what I'm doing

wrong.

I am trying to calculate a weighted average, but some of my metrics are
missing, so when they're missing, I'd like the average to adjust
automatically to include just the metrics I have numbers for.

Example

Weights 20 30 30 20 Function
Metric 10 10 10 10 (10*20+10*30+10*30+20*30)/100
Metric 10 5 (10*20+5*30)/50
Metric 10 10 (10*20+10*20)/40

Any idea how to achieve this?

Thanks for your help!!!!
Andreea

--
Message posted via http://www.officekb.com



  #3   Report Post  
Ken Wright
 
Posts: n/a
Default

By the way I can't get any formula to equal your first example :-)

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------
<snip


  #4   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

Ken Wright wrote:
By the way I can't get any formula to equal your first example :-)


Ken,

I guess the OP has a specification error there.

BTW, the formula can be a bit less expensive with SumIf:

=SUMPRODUCT($B$1:$E$1,B2:E2)/SUMIF(B2:E2,"<",$B$1:$E$1)

Aladin
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
Can I reference =, <, or > sign in SUMPRODUCT BobT Excel Discussion (Misc queries) 7 February 16th 05 01:58 PM
SUMIF function yak10 Excel Worksheet Functions 0 February 12th 05 05:12 PM
Sumproduct Function problem JRod Excel Worksheet Functions 3 February 7th 05 06:28 PM
Sumproduct function not working Scott Summerlin Excel Worksheet Functions 12 December 4th 04 05:15 AM
adding two sumproduct formulas together ski2004_2005 Excel Worksheet Functions 1 November 12th 04 09:08 PM


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