In pseudo logic, for x = 1 to 10 I want to find each Ax:Bx pairing in
Cy:Dy and sum E when matched. So I want to sum Ey for the rows where [Cy
is "A" and Dy is "Z"], plus each Ey where [Cy="Q" and Dy="B"], etc. for
the sample data above. Thus for what I presented, the C:D matches to
A:B give the solution 2 + 9 + 5.
Of course this could be done systematically in VBA, but to do in Excel I
can't escape adding a helper column F1:F10 and summing that. I've tried
all sorts of SUM() and SUMPRODUCT and ISNUMBER(MATCH) and coercion and
array formula entry and it just isn't happening for me. I've read scores
of Aladin solutions and can't find one to fit this exactly.
I see it as a 3 term SUMPRODUCT or SUM(x*y*z) or SUM(IF...; with a
simple 3rd term ",E$1:E$100)" . --(ISNUMBER(MATCH seemed most promising
and I tried to run through every permutation. Just for the A and C part
(B and D are analogous) I've homed in on (A1:A$10,C$1:C$100), adding $
in A1, reversing the A and C order, removing the A$10 ... it laughs at
everything I throw at it. Please make mincemeat of this troublesome
beast :( :(
E A N J 1
B W M A 2
L H S H 3
Y C J J 4
H I N J 5
N V E G 6
W O D R 7
I L K R 8
T U A S 9
J B S U 10
N I 11
A C 12
C Q 13
J B 14
O N 15
I L 16
W Y 17
O A 18
J E 19
N P 20
G N 21
H L 22
F N 23
I C 24
N G 25
V J 26
N T 27
A C 28
Q C 29
W U 30
O N 31
G U 32
N J 33
M X 34
R B 35
L F 36
L O 37
S H 38
F B 39
F P 40
C P 41
F T 42
X M 43
N E 44
R Q 45
P N 46
F O 47
O A 48
Z Q 49
O F 50
D W 51
Z E 52
R T 53
H D 54
P F 55
T N 56
K I 57
T U 58
Y L 59
W B 60
O G 61
P U 62
P W 63
N N 64
R K 65
P G 66
Q N 67
X L 68
Z U 69
U Y 70
T E 71
M Y 72
W U 73
H F 74
R R 75
P J 76
B T 77
W X 78
U D 79
B F 80
A A 81
W D 82
Q G 83
V O 84
P E 85
N W 86
G U 87
M M 88
P X 89
Z K 90
R F 91
N K 92
G H 93
V F 94
L M 95
P X 96
O M 97
Q X 98
J Z 99
A Y 100
then the following:
=SUMPRODUCT(((--(C$1:C$100=A1)*(--(D$1:D$100=B1))*(E$1:E$100))))
=SUMPRODUCT(((--(C$1:C$100=A2)*(--(D$1:D$100=B2))*(E$1:E$100))))
=SUMPRODUCT(((--(C$1:C$100=A3)*(--(D$1:D$100=B3))*(E$1:E$100))))
=SUMPRODUCT(((--(C$1:C$100=A4)*(--(D$1:D$100=B4))*(E$1:E$100))))
=SUMPRODUCT(((--(C$1:C$100=A5)*(--(D$1:D$100=B5))*(E$1:E$100))))
=SUMPRODUCT(((--(C$1:C$100=A6)*(--(D$1:D$100=B6))*(E$1:E$100))))
=SUMPRODUCT(((--(C$1:C$100=A7)*(--(D$1:D$100=B7))*(E$1:E$100))))
=SUMPRODUCT(((--(C$1:C$100=A8)*(--(D$1:D$100=B8))*(E$1:E$100))))
=SUMPRODUCT(((--(C$1:C$100=A9)*(--(D$1:D$100=B9))*(E$1:E$100))))
=SUMPRODUCT(((--(C$1:C$100=A10)*(--(D$1:D$100=B10))*(E$1:E$100))))
yield:
0
0
0
0
0
0
0
16
58
14
--
Gary''s Student - gsnu200746
=SUMPRODUCT(--ISNUMBER(MATCH(C$1:C$100&D$1:D$100,A$1:A$10&B$1:B$10,0)),E$1:E$100)
Note that if you reverse the MATCH terms it fails; its first term must
be the nonunique pair (C&D).
On Sat, 22 Sep 2007 15:14:01 -0700, Gary''s Student
<GarysS...@discussions.microsoft.com> wrote:
>=SUMPRODUCT(((--(C$1:C$100=A1)*(--(D$1:D$100=B1))*(E$1:E$100))))
>=SUMPRODUCT(((--(C$1:C$100=A2)*(--(D$1:D$100=B2))*(E$1:E$100))))
>=SUMPRODUCT(((--(C$1:C$100=A3)*(--(D$1:D$100=B3))*(E$1:E$100))))
>=SUMPRODUCT(((--(C$1:C$100=A4)*(--(D$1:D$100=B4))*(E$1:E$100))))
>=SUMPRODUCT(((--(C$1:C$100=A5)*(--(D$1:D$100=B5))*(E$1:E$100))))
>=SUMPRODUCT(((--(C$1:C$100=A6)*(--(D$1:D$100=B6))*(E$1:E$100))))
>=SUMPRODUCT(((--(C$1:C$100=A7)*(--(D$1:D$100=B7))*(E$1:E$100))))
>=SUMPRODUCT(((--(C$1:C$100=A8)*(--(D$1:D$100=B8))*(E$1:E$100))))
>=SUMPRODUCT(((--(C$1:C$100=A9)*(--(D$1:D$100=B9))*(E$1:E$100))))
>=SUMPRODUCT(((--(C$1:C$100=A10)*(--(D$1:D$100=B10))*(E$1:E$100))))
I humbly extend that gratitude to a significant number of you in the NGs
- and stand gaping at how some of you manage it so prodigiously. I used
to think God only allocated us one Ogilvy - but there are a lot of you.
sumproduct(--(range1=x),--(range2=y),range3)
and the benefit vis-à-vis the multiplied arrays besides being slightly
faster is that it ignores text in the sum range whereas multiplying causes
value errors
--
Regards,
Peo Sjoblom
"Gary''s Student" <GarysS...@discussions.microsoft.com> wrote in message
news:71D06E96-17FB-4D6A...@microsoft.com...
On Sat, 22 Sep 2007 17:12:37 -0700, "Peo Sjoblom" <ter...@mvps.org>
wrote:
--
Regards,
Peo Sjoblom
"Wild Bill" <Decapitat...@myspam.com> wrote in message
news:46febe7e...@news-server.tx.rr.com...