View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Conditional formula

=SUMPRODUCT(--(A1:A20=1),--(B1:B20=1),D1:D20)

These expressions will return an array of either TRUE or FALSE:

(A1:A20=1)
(B1:B20=1)

The "--" coerces the TRUE and FALSE to either 1 or 0. Then, all 3 arrays are
multiplied together then summed for the result. Based on the first few cells
in your range it would look like this:

1*1*8.911 = 8.911
1*1*9.058 = 9.058
1*1*9.106 = 9.106
1*1*9.031 = 9.031
1*0*9.883 = 0

=SUMPRODUCT({8.911;9.058;9.106;9.031;0}) = 36.106



--
Biff
Microsoft Excel MVP


"tsterople" wrote in message
...
OUT F#*%KING STANDING BIFF! I try very hard to answer my own questions and
have labored over this one for weeks, thank you so much...can you
elaborate
on the notational format,(--)?
--
tsterople


"T. Valko" wrote:

Try this:

=SUMPRODUCT(--(A1:A20=1),--(B1:B20=1),D1:D20)

--
Biff
Microsoft Excel MVP


"tsterople" wrote in message
...
I need a formula to sum a conditional array, If A is 1 and B is 1 SUM
the
cooresponding D values 8.911, 9.058, 9.106, 9.031. In this example I
have
A
part 1, B Appraiser 1, C number of trials i.e. 1, 2, 3, 4 and D values
8.911,
9.058, 9.106, 9.031.

A B C D
1 1 1 8.911
1 1 2 9.058
1 1 3 9.106
1 1 4 9.031
1 2 1 9.883
1 2 2 9.292
1 2 3 9.793
1 2 4 9.353
1 3 1 9.491
1 3 2 9.731
1 3 3 9.057
1 3 4 9.304
2 1 1 13.632
2 1 2 13.827
2 1 3 13.184
2 1 4 13.532
2 2 1 15.32
2 2 2 15.037
2 2 3 14.884
2 2 4 15.31
2 3 1 16.317
2 3 2 16.48
2 3 3 16.31
2 3 4 16.256



--
tsterople