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

Hi All,

I am trying to get a sumproduct formula to work and can't figure it
out. These two formulas work:

=SUMPRODUCT((MODEL_DATA!M2:M65536)*(MODEL_DATA!L2: L65536=1)*(MODEL_DATA!K2:K65536=1)*(MODEL_DATA!D2: D65536=IF(MODEL_SETUP!C7<0,MODEL_SETUP!C7,{1,2,3, 4,5,6})))

=SUMPRODUCT((MODEL_DATA!M2:M65536)*(MODEL_DATA!L2: L65536=1)*(MODEL_DATA!K2:K65536=1)*(MODEL_DATA!E2: E65536=IF(MODEL_SETUP!C8<0,MODEL_SETUP!C8,{1,2})) )

But if I combine the last criteria of both, it causes an #N/A error:

=SUMPRODUCT((MODEL_DATA!M2:M65536)*(MODEL_DATA!L2: L65536=1)*(MODEL_DATA!K2:K65536=1)*(MODEL_DATA!D2: D65536=IF(MODEL_SETUP!C7<0,MODEL_SETUP!C7,{1,2,3, 4,5,6}))*(MODEL_DATA!E2:E65536=IF(MODEL_SETUP!C8< 0,MODEL_SETUP!C8,{1,2})))

For the last two criteria, basically what I what it to do is if the
lookup value = 0, return 1 for all rows, but if it equals another
value, return 1 only if the value in the range matches. I can't figure
out how to get both criteria to work in one formula, any suggestions on
fixing the error or a simpler way of doing the calculation would be
appreciated.

Michael Card

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Sumproduct Error

That is because the 1st criteria results in a (n x 6) array and you try to
multiply the results of the second criteria which is a (nx2) array. This
results in a (n x 6) array with the last four columns all filled with N/A.

This is of course when both the false conditions kick in applying the Array
constants.

--
Regards,
Tom Ogilvy



" wrote:

Hi All,

I am trying to get a sumproduct formula to work and can't figure it
out. These two formulas work:

=SUMPRODUCT((MODEL_DATA!M2:M65536)*(MODEL_DATA!L2: L65536=1)*(MODEL_DATA!K2:K65536=1)*(MODEL_DATA!D2: D65536=IF(MODEL_SETUP!C7<0,MODEL_SETUP!C7,{1,2,3, 4,5,6})))

=SUMPRODUCT((MODEL_DATA!M2:M65536)*(MODEL_DATA!L2: L65536=1)*(MODEL_DATA!K2:K65536=1)*(MODEL_DATA!E2: E65536=IF(MODEL_SETUP!C8<0,MODEL_SETUP!C8,{1,2})) )

But if I combine the last criteria of both, it causes an #N/A error:

=SUMPRODUCT((MODEL_DATA!M2:M65536)*(MODEL_DATA!L2: L65536=1)*(MODEL_DATA!K2:K65536=1)*(MODEL_DATA!D2: D65536=IF(MODEL_SETUP!C7<0,MODEL_SETUP!C7,{1,2,3, 4,5,6}))*(MODEL_DATA!E2:E65536=IF(MODEL_SETUP!C8< 0,MODEL_SETUP!C8,{1,2})))

For the last two criteria, basically what I what it to do is if the
lookup value = 0, return 1 for all rows, but if it equals another
value, return 1 only if the value in the range matches. I can't figure
out how to get both criteria to work in one formula, any suggestions on
fixing the error or a simpler way of doing the calculation would be
appreciated.

Michael Card


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
Sumproduct error Gotroots Excel Worksheet Functions 8 February 24th 10 04:38 PM
another sumproduct with #value error... Maya[_2_] Excel Worksheet Functions 5 September 21st 09 02:19 PM
SUMPRODUCT with #VALUE error Joe Gieder Excel Worksheet Functions 3 December 12th 07 07:09 PM
SUMPRODUCT #N/A error R Ormerod Excel Discussion (Misc queries) 7 April 14th 07 02:56 AM
Sumproduct value error Brad Excel Worksheet Functions 7 October 31st 06 09:47 PM


All times are GMT +1. The time now is 11:44 AM.

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"