Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default what is wrong with this formula

=SUMPRODUCT((A1:A21=D1)*(B1:B21),(F1:F7))/SUMPRODUCT(--(A1:A21=D1),--(B1:B21))

results in #VALUE!

#WHY?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 905
Default what is wrong with this formula

"Norbert" wrote:
=SUMPRODUCT((A1:A21=D1)*(B1:B21),(F1:F7))
/SUMPRODUCT(--(A1:A21=D1),--(B1:B21))
results in #VALUE! #WHY?


One reason: because the ranges A1:A21, B1:B21 and F1:F7 are not all the
same size.

Another possible reason: If "F1:F7" is a typo and you mean F1:F21, because
some cells in B1:B21 contain text, not numbers or boolean values (true,
false).

If B1:B21 contains boolean values (true, false), then the formula can be
rewritten as follows:

=SUMPRODUCT(--(A1:A21=D1),--B1:B21,F1:F21)
/SUMPRODUCT(--(A1:A21=D1),--B1:B21)

If you want to consider only numeric values in B1:B21, then use one of the
following formulas(equivalent):

=SUMPRODUCT(--(A1:A21=D1),B1:B21,F1:F21)
/SUMPRODUCT(--(A1:A21=D1),B1:B21)

or

=SUMPRODUCT(--(A1:A21=D1),B1:B21,F1:F21)
/SUMIF(A1:A21,D1,B1:B21)

The double negation ("--") is needed only to convert boolean values (true,
false) to numbers (1, 0).

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
Formula returning "A value used in the formula is of the wrong dat Mac0001UK Excel Worksheet Functions 2 June 2nd 09 04:06 AM
WHat is wrong with this formula Sportinus Excel Worksheet Functions 2 July 9th 08 12:07 AM
What's wrong with this formula? Alain Sienaert Excel Worksheet Functions 9 September 19th 07 08:36 PM
###### Wrong Formula Ningster Excel Discussion (Misc queries) 8 July 8th 06 01:09 AM
What's wrong with this formula? Ken M. Excel Worksheet Functions 6 February 5th 05 02:00 PM


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