Frank K and Bob P

C

Charlie

I am becoming a fan of both of you. Your answers to some
very confusing questions is outstanding. I've learned a
lot from reading this newsgroup. I would like to know if
there is a location where I can read in more detail some
logic to your formula's. For example the SumProduct
function. Excel help is very limited in explaining the
use of this function. I would like to find some example
situations where the SumProduct is the best function to
use and how.

Thanks to a couple of real knowledge people. You both are
appreciated.

Charlie O'Neill
 
B

Bob Phillips

Charlie,

Such kind words, I am blushing.

Most of this knowledge is gained by experience. I would venture that no
amount of reading would come up with some of the formulae that the likes of
Jason Morin, Aladin Akyurek, John McGimpsey, Peo Sjoblom, and the late
George Simms have concocted in their time, so keep looking here, I still
find it a mine of information.

As to SUMPRODUCT, what you see is an odd variation on its 'proper' use,
which I would venture to suggest was 'invented' in these NGs. For an
excellent explanation as to the mechanics of the solution, see Ken Wright's
excellent explanation in this previous post http://tinyurl.com/v85r

By the way, from all of the above name dropping, you can see the wonderful
support that these NGs get, and the cultural diversity too, Yanks, Dutch,
Swedish, Brits, Frank is German of course, and we even have some Ozzies (but
we keep that quiet).

Keep visiting, you'll like it.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
F

Frank Kabel

By the way, from all of the above name dropping, you can see the
wonderful support that these NGs get, and the cultural diversity too,
Yanks, Dutch, Swedish, Brits, Frank is German of course, and we even
have some Ozzies (but we keep that quiet).

Psstttt :)
 
K

Ken Wright

Charlie, the following may help you to understand SUMPRODUCT, and there is a
load of example syntx listed at the end.

The formula exploits the fact that Excel interprets TRUE as 1 and FALSE
as 0. Take the formula below:-

=SUMPRODUCT((A9:A20=A1)*(B9:B20="A")*(C9:C20))

This sets up an array that gives you something that looks like this
(depending on the variables of course):-

A B C
9 TRUE * FALSE * 3
10 FALSE * FALSE * 4
11 TRUE * TRUE * 2
12 TRUE * TRUE * 1
13 TRUE * FALSE * 4
14 TRUE * TRUE * 3
15 TRUE * TRUE * 2
16 FALSE * TRUE * 8
17 TRUE * TRUE * 6
18 TRUE * TRUE * 8
19 TRUE * TRUE * 7
20 TRUE * TRUE * 6

Which because TRUE=1 and FALSE=0, is interpreted as:-

A B C
9 1 * 0 * 3 = 0
10 0 * 0 * 4 = 0
11 1 * 1 * 2 = 2
12 1 * 1 * 1 = 1
13 1 * 0 * 4 = 0
14 1 * 1 * 3 = 3
15 1 * 1 * 2 = 2
16 0 * 1 * 8 = 0
17 1 * 1 * 6 = 6
18 1 * 1 * 8 = 8
19 1 * 1 * 7 = 7
20 1 * 1 * 6 = 6
-------------
35

and the SUM bit just adds up all the end values of the products



If you exclude the last part of the formula, so that it becomes:-

=SUMPRODUCT((A9:A20=A1)*(B9:B20="A"))

then what you end up with is a sum of a bunch of TRUE/FALSE values depending on
whether or not the criteria has been met on that row, and this is the same as
counting the number of records that meet your criteria. Imagine the above
tables without Column C, and the last one would look like the following:-

A B
9 1 * 0 = 0
10 0 * 0 = 0
11 1 * 1 = 1
12 1 * 1 = 1
13 1 * 0 = 0
14 1 * 1 = 1
15 1 * 1 = 1
16 0 * 1 = 0
17 1 * 1 = 1
18 1 * 1 = 1
19 1 * 1 = 1
20 1 * 1 = 1
-------------
8


SumProduct - Examples of Syntax
=SUMPRODUCT(($A$1:$A$100="L")*(CODE($B$1:$B$100)=66))
=SUMPRODUCT(($A$1:$A$100="L")*(CODE(UPPER($B$1:$B$100))=66))
=SUMPRODUCT(($A$1:$A$100="L")*(LEFT($B$1:$B$100,1)="b"))
=SUMPRODUCT(($B$6:$B$14=E6)*($C$6:$C$14=F6)*($D$6:$D$14))
=SUMPRODUCT((A1:A100="apples")*(C1:C100="Spain")*(D1:D100))
=SUMPRODUCT((A1:A100>=$E$1)*(A1:A100<=$E$2)*(B1:B100=$E$3)*(C1:C100=$E$4)*D1:D10
0)
=SUMPRODUCT((A1:A100>=1)*(A1:A100<=100)*A1:A100)/SUMPRODUCT((A1:A100>=1)*(A1:A10
0<=100))
=SUMPRODUCT((A1:A20<0)*(B1:B20))/SUMPRODUCT((A1:A20<0)*1)
=SUMPRODUCT((A1:A20=13)*(B1:B20>6)*C1:C20)
=SUMPRODUCT((A1:A20=2003)*(B1:B20=1)*C1:C20)
=SUMPRODUCT((A1:A365>=DATEVALUE("10/01/2002")) *
(A1:A365<DATEVALUE("11/01/2002")) * (C1:C365))
=SUMPRODUCT((A1:A4="X")*(B1:B4="N")*C1:C4)
=SUMPRODUCT((A2:A100="red")+(A2:A100="blue")+(A2:A100="yellow"),B2:B100)
=SUMPRODUCT((A2:A100={"red","blue","yellow"})*B2:B100)
=SUMPRODUCT((A2:A105=D1)+(A2:A105=E1)+(A2:A105=F1),B2:B105)
=SUMPRODUCT((A2:A120={"red","blue","yellow"})*(B2:B120))
=SUMPRODUCT((A2:A120=D1:F1)*(B2:B120))
=SUMPRODUCT((A2:A120=D1:F1)*(B2:B150))
=SUMPRODUCT((A2:B100="YourClass")*(B2:B100="YourSize")*C2:C100)
=SUMPRODUCT((A8:A200="Jan")*(B2:B10="Week 1")*H8:H200)
=SUMPRODUCT((A9:A25="blue")*ABS(C9:C25))
=SUMPRODUCT((B40:AE40=TRUE)*(B41:AE41="V"))
=SUMPRODUCT((dts>st)*(dts<=nd)*(B4:M4))
=SUMPRODUCT((EXACT(LEFT(data,1),"s")+0))
=SUMPRODUCT((LEFT(INDIRECT($B23&"!H2:H4500"),4)=C$3)*(INDIRECT($B23&"!F2:F4500")
=C$2),INDIRECT($B23&"!G2:G4500"))
=SUMPRODUCT((MOD(COLUMN(J3:AE3)-3,7)=0)*(J3:AE3)) Every 7th column
=SUMPRODUCT((MOD(COLUMN(J3:IV3)-3,7)=0)*(J3:IV3)) Every 7th column
=SUMPRODUCT((MOD(ROW(A1:A10),2)=0)*(A1:A10)) To find every 2nd row, starting
with row 2 (will add rows 2, 4, 6, 8, and 10):
=SUMPRODUCT((MOD(ROW(A1:A10),2)=1)*(A1:A10)) To find every 2nd row, starting
with row 1 (will add rows 1, 3, 5, 7, and 9):
=SUMPRODUCT((MOD(ROW(A1:A10),3)=0)*(A1:A10)) To find every 3rd row, starting
with row 3 (will add rows 3, 6, and 9): To find every 4th, 5th, 6th, etc...,
starting with row 4, 5, 6, etc..., just change the number 3 in the above formula
to 4, 5, 6, etc.
=SUMPRODUCT((MOD(ROW(A1:A10),3)=1)*(A1:A10)) To find every 3rd row, starting
with row 1 (will add rows 1, 4, 7, and 10): To find every 4th, 5th, 6th, etc...,
starting with row 1, just change the number 3 in the above formula to 4, 5, 6,
etc.
=SUMPRODUCT((MOD(ROW(A1:A97),7)=0)*A1:A97)
=SUMPRODUCT((MOD(ROW(A1:A97),7)=1)*A1:A97)
=SUMPRODUCT((MOD(ROW(Range)-CELL("Row",Range)+H1,H2)=0)*(Range))
=SUMPRODUCT((MONTH(A1:A100)=6)*B1:B100)
=SUMPRODUCT((MONTH(A1:A300)=2)*(ISNUMBER(A1:A300)))
=SUMPRODUCT((MONTH(A1:A500)=1)*(B1:B500))
=SUMPRODUCT((MONTH(A8:A21)=MONTH(G3))*(B8:B21))
=SUMPRODUCT((MONTH(B2:B9)=11)*(A2:A9="Pending"))
=SUMPRODUCT((range1="L")*(LEFT(range2)="B"))
=SUMPRODUCT((Range1=A1)*(Range2=B1)*(Range3=C1))
=SUMPRODUCT((RNGA="A")*(RNGB=1)*RNGC)
=SUMPRODUCT((Sheet2!A1:A100>=Sheet1!A1)*(Sheet2!A1:A100<=DATE(YEAR(Sheet1!A1),MO
NTH(Sheet1!A1)+Sheet1!A2-1,DAY(Sheet1!A1)))*(Sheet2!B1:B100))
=SUMPRODUCT((TEXT(B1:B5,"mmm")="Oct")*A1:A5)
=SUMPRODUCT((YEAR(B2:B9)=2002)*(MONTH(B2:B9)=11)*(A2:A9="Pending"))
=SUMPRODUCT(A1:A3,TRANSPOSE(B2:D2)) Array Entered??
=SUMPRODUCT(A2:A5;B2:B5)
=SUMPRODUCT(A2:A56,B2:B56)+SUMPRODUCT(A58:A62,B58:B62)+SUMPRODUCT(A64:A75,B64:B7
5)
=SUMPRODUCT(ABS(A1:A10)*1)
=SUMPRODUCT(COUNTIF(INDIRECT("Week" &(ROW(INDIRECT("1:11")))&"!D4:D19"),"CORP"))
=SUMPRODUCT(MOD(COLUMN(I8:IS8),2),I8:IS8)
=SUMPRODUCT(MONTH(B1:B5=9)*A1:A5)
=SUMPRODUCT(N(C2:C765={"B","TB"}))
=SUMPRODUCT(N(EXACT(C2:C765,{"B","TB"})))
=SUMPRODUCT(SUMIF(INDIRECT("'Respondent
NO"&ROW(INDIRECT("1:50"))&"'!C1"),1,INDIRECT("'Respondent
NO"&ROW(INDIRECT("1:50"))&"'!A1")))
=SUMPRODUCT(SUMIF(INDIRECT(ROW(1:35)&"!B1"),TRUE,INDIRECT(ROW(1:35)&"!A5")))
=SUMPRODUCT(x^(ROW(INDIRECT("1:"&CEILING(T,1)))*{1,-1}+T*{0,1}))
=SUMPRODUCT(LARGE(IF(A1:A100="Harry",B1:B100,0),{1,2,3}))
 
B

Bob Phillips

Oy! I've already name dropped you and referred to this explanation.

Anyway, how are you. Drop me an email telling me what you are up to.

Bob
 
G

Guest

Thanks Guys, I really appreciate the help, and Ken thanks
for the examples of sumproduct syntax. I've printed it
out and will try and get through it.

I think I found a home, in this newsgroup.

Charlie O'Neill
 
K

Ken Wright

I think I found a home, in this newsgroup.

LOL - My wife often suggests that this more my home than my real home (Gets to
be addictive though). :-(
 
K

Ken Wright

LOL - Been a very very stressful couple of weeks (Especially considering I was
*supposed* to have been on holiday for one of them), and I am just sooooooooo
glad it is over. Proposal delivered, and now time to relax for a short while
:)
 
N

Norman Harker

Hi Frank!

Re: "we even have some Ozzies (but we keep that quiet)."

I resemble that remark!! Just because you don't play cricket in
Frankfurt!


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
N

Norman Harker

Hi Frank!

Re: "I would like to know if there is a location where I can read in
more detail some logic to your formula's"

As a general reference on formulas perhaps the best text is John
Walkenbach's Excel 2003 Formulas.

I'll extend Frank's list of sites as follows:

PRIME
Chip Pearson:
http://www.cpearson.com/excel/topic.htm
Ranked number one equal because his index is so crystal clear and
content so broad
Dave McRitchie
http://www.mvps.org/dmcritchie/excel/xlindex.htm
Ranked number one for breadth of content but the index is necessarily
more difficult.
John Walkenbach
http://j-walk.com/ss/excel/index.htm
Lots of useful Add-ins and downloadable examples from one of the most
popular writers of Excel texts.

Then there's a special link that is worth going to immediately:
SPECIAL
Ron de Bruin
www.rondebruin.nl/Google.htm
Ron has an Add-In that you can download free of charge. It installs a
Google search tool under your Help menu in Excel. If you don't Google
search Excel problems now, you will soon do so when you get the hang
of it. Search on a particular function name, for example, and you'll
get hundreds of examples of formulas where that function is used.

SECONDARY

I've left out many real gems on the web. I plead guilty and ask for
the need for selectivity to be taken into account. Plus, even with
NetCaptor it does take time to download all the front pages. But just
briefly and all with different strengths in different areas:

http://www.bmsltd.co.uk/Excel/Default.htm
http://contextures.com/tiptech.html
http://www.erlandsendata.no/english/index.htm
http://www.mvps.org/vb/
http://www.decisionmodels.com/calcsecretsj.htm
http://www.vbapro.com/
http://www.rb-ad.dircon.co.uk/rob/excelvba/tips/index.htm
http://www.pcmag.com/category2/0,4148,29,00.asp
http://www.tushar-mehta.com/
http://www.geocities.com/jonpeltier/Excel/Charts/index.html

http://www.mcgimpsey.com/excel/index



MICROSOFT

http://support.microsoft.com/default.aspx?scid=fh;en-us;kbinfo
http://www.microsoft.com/downloads/search.asp?
http://www.microsoft.com/
http://support.microsoft.com/default.aspx?scid=/support/Excel/Content/CoolTips/cool.asp#E10E28

Finally, if you want an explanation of why or what a formula is doing,
just ask. No one on these groups is just after providing solutions;
it's the "teach a person to fish" approach that is preferred. There
are no stupid questions! Only stupid people who don't ask them when
friendly help is available free.


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
F

Frank Kabel

Norman said:
Hi Frank!

Re: "we even have some Ozzies (but we keep that quiet)."

I resemble that remark!! Just because you don't play cricket in
Frankfurt!

Hi Norman
to be honest I doubt that any German will ever understand the rules of
this game :)
We just play soccer - though not that good at the moment :-(

Frank
 
F

Frank Kabel

Norman said:
Hi Frank!

Re: "I would like to know if there is a location where I can read in
more detail some logic to your formula's"

As a general reference on formulas perhaps the best text is John
Walkenbach's Excel 2003 Formulas.

I'll extend Frank's list of sites as follows:

Hi Norman
this was the list I was looking for but didn't found it :)
 
N

Norman Harker

Hi Frank!

It was part of a reply to "How do I become an Excel Expert"

Here's a recent link as I tend to update from time to time:

http://tinyurl.com/ytfot

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
B

Bob Phillips

Poor old Norman, his mind's going. He's even attributing (blaming?) the
wrong person now.

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top