Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-2008, 01:38 PM
Stan Brown
 
Posts: n/a
SUMPRODUCT to test two conditions

In my checking-account spreadsheet, I have
A4 and below - date
E4 and below - deposit amount
H4 and below - comment
B2 - today's date or as-of date
(Rows 1 to 3 of columns A and E are just text headers, not numbers or
formulas.)

I want to summarize interest for the current year (year that matches
B2's year, comment equals "Interest"). The following array formula
works, but I have to remember to update it when transactions go below
row 699:

{ =SUM( (YEAR(A4:A699)=YEAR(B$2))*(H4:H699="Interest")*E4: E699 ) }

It seems this should be doable with a sumproduct, so I type:

=SUMPRODUCT(E:E, --(YEAR(A:A)=YEAR($B$2)), --(H:H="Interest"))

but I get a #NUM. When I change it to

=SUMPRODUCT(E4:E, --(YEAR(A4:A)=YEAR($B$2)), --(H4:H="Interest"))

I get #NAME.

Making the references absolute didn't help:

=SUMPRODUCT($E:$E, --(YEAR($A:$A)=YEAR($B$2)), --($H:$H="Interest"))

still gets #NUM.

What am I doing wrong, and what's the solution? Thanks!

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
"If there's one thing I know, it's men. I ought to: it's
been my life work." -- Marie Dressler, in /Dinner at Eight/
Reply With Quote
  #2 (permalink)  
Old 01-13-2008, 01:56 PM
Sandy Mann
 
Posts: n/a
Re: SUMPRODUCT to test two conditions

SUMPROUCT(), like array formulas, cannot work with whole columns. Try
making the whole columns ranges even if it is B4:A65535 but having such a
large range may slow your sheet down somewhat.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk


"Stan Brown" <the_stan_brown@fastmail.fm> wrote in message
news:MPG.21f3de679ac9710c98b39d@news.individual.ne t...
> In my checking-account spreadsheet, I have
> A4 and below - date
> E4 and below - deposit amount
> H4 and below - comment
> B2 - today's date or as-of date
> (Rows 1 to 3 of columns A and E are just text headers, not numbers or
> formulas.)
>
> I want to summarize interest for the current year (year that matches
> B2's year, comment equals "Interest"). The following array formula
> works, but I have to remember to update it when transactions go below
> row 699:
>
> { =SUM( (YEAR(A4:A699)=YEAR(B$2))*(H4:H699="Interest")*E4: E699 ) }
>
> It seems this should be doable with a sumproduct, so I type:
>
> =SUMPRODUCT(E:E, --(YEAR(A:A)=YEAR($B$2)), --(H:H="Interest"))
>
> but I get a #NUM. When I change it to
>
> =SUMPRODUCT(E4:E, --(YEAR(A4:A)=YEAR($B$2)), --(H4:H="Interest"))
>
> I get #NAME.
>
> Making the references absolute didn't help:
>
> =SUMPRODUCT($E:$E, --(YEAR($A:$A)=YEAR($B$2)), --($H:$H="Interest"))
>
> still gets #NUM.
>
> What am I doing wrong, and what's the solution? Thanks!
>
> --
> Stan Brown, Oak Road Systems, Tompkins County, New York, USA
> http://OakRoadSystems.com/
> "If there's one thing I know, it's men. I ought to: it's
> been my life work." -- Marie Dressler, in /Dinner at Eight/
>



Reply With Quote
  #3 (permalink)  
Old 01-13-2008, 01:56 PM
Sandy Mann
 
Posts: n/a
Re: SUMPRODUCT to test two conditions

SUMPROUCT(), like array formulas, cannot work with whole columns. Try
making the whole columns ranges even if it is B4:A65535 but having such a
large range may slow your sheet down somewhat.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk


"Stan Brown" <the_stan_brown@fastmail.fm> wrote in message
news:MPG.21f3de679ac9710c98b39d@news.individual.ne t...
> In my checking-account spreadsheet, I have
> A4 and below - date
> E4 and below - deposit amount
> H4 and below - comment
> B2 - today's date or as-of date
> (Rows 1 to 3 of columns A and E are just text headers, not numbers or
> formulas.)
>
> I want to summarize interest for the current year (year that matches
> B2's year, comment equals "Interest"). The following array formula
> works, but I have to remember to update it when transactions go below
> row 699:
>
> { =SUM( (YEAR(A4:A699)=YEAR(B$2))*(H4:H699="Interest")*E4: E699 ) }
>
> It seems this should be doable with a sumproduct, so I type:
>
> =SUMPRODUCT(E:E, --(YEAR(A:A)=YEAR($B$2)), --(H:H="Interest"))
>
> but I get a #NUM. When I change it to
>
> =SUMPRODUCT(E4:E, --(YEAR(A4:A)=YEAR($B$2)), --(H4:H="Interest"))
>
> I get #NAME.
>
> Making the references absolute didn't help:
>
> =SUMPRODUCT($E:$E, --(YEAR($A:$A)=YEAR($B$2)), --($H:$H="Interest"))
>
> still gets #NUM.
>
> What am I doing wrong, and what's the solution? Thanks!
>
> --
> Stan Brown, Oak Road Systems, Tompkins County, New York, USA
> http://OakRoadSystems.com/
> "If there's one thing I know, it's men. I ought to: it's
> been my life work." -- Marie Dressler, in /Dinner at Eight/
>



Reply With Quote
  #4 (permalink)  
Old 01-13-2008, 02:45 PM
Don Guillett
 
Posts: n/a
Re: SUMPRODUCT to test two conditions

try this
=SUMPRODUCT(--(YEAR(A2:A22)=YEAR($B$2),--(H2:H22="Interest"),e2:e22)
or
=SUMPRODUCT((YEAR(A2:A22)=YEAR($B$2)*(H2:H22="Inte rest")*e2:e22)


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
"Stan Brown" <the_stan_brown@fastmail.fm> wrote in message
news:MPG.21f3de679ac9710c98b39d@news.individual.ne t...
> In my checking-account spreadsheet, I have
> A4 and below - date
> E4 and below - deposit amount
> H4 and below - comment
> B2 - today's date or as-of date
> (Rows 1 to 3 of columns A and E are just text headers, not numbers or
> formulas.)
>
> I want to summarize interest for the current year (year that matches
> B2's year, comment equals "Interest"). The following array formula
> works, but I have to remember to update it when transactions go below
> row 699:
>
> { =SUM( (YEAR(A4:A699)=YEAR(B$2))*(H4:H699="Interest")*E4: E699 ) }
>
> It seems this should be doable with a sumproduct, so I type:
>
> =SUMPRODUCT(E:E, --(YEAR(A:A)=YEAR($B$2)), --(H:H="Interest"))
>
> but I get a #NUM. When I change it to
>
> =SUMPRODUCT(E4:E, --(YEAR(A4:A)=YEAR($B$2)), --(H4:H="Interest"))
>
> I get #NAME.
>
> Making the references absolute didn't help:
>
> =SUMPRODUCT($E:$E, --(YEAR($A:$A)=YEAR($B$2)), --($H:$H="Interest"))
>
> still gets #NUM.
>
> What am I doing wrong, and what's the solution? Thanks!
>
> --
> Stan Brown, Oak Road Systems, Tompkins County, New York, USA
> http://OakRoadSystems.com/
> "If there's one thing I know, it's men. I ought to: it's
> been my life work." -- Marie Dressler, in /Dinner at Eight/


Reply With Quote
  #5 (permalink)  
Old 01-13-2008, 02:45 PM
Don Guillett
 
Posts: n/a
Re: SUMPRODUCT to test two conditions

try this
=SUMPRODUCT(--(YEAR(A2:A22)=YEAR($B$2),--(H2:H22="Interest"),e2:e22)
or
=SUMPRODUCT((YEAR(A2:A22)=YEAR($B$2)*(H2:H22="Inte rest")*e2:e22)


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
"Stan Brown" <the_stan_brown@fastmail.fm> wrote in message
news:MPG.21f3de679ac9710c98b39d@news.individual.ne t...
> In my checking-account spreadsheet, I have
> A4 and below - date
> E4 and below - deposit amount
> H4 and below - comment
> B2 - today's date or as-of date
> (Rows 1 to 3 of columns A and E are just text headers, not numbers or
> formulas.)
>
> I want to summarize interest for the current year (year that matches
> B2's year, comment equals "Interest"). The following array formula
> works, but I have to remember to update it when transactions go below
> row 699:
>
> { =SUM( (YEAR(A4:A699)=YEAR(B$2))*(H4:H699="Interest")*E4: E699 ) }
>
> It seems this should be doable with a sumproduct, so I type:
>
> =SUMPRODUCT(E:E, --(YEAR(A:A)=YEAR($B$2)), --(H:H="Interest"))
>
> but I get a #NUM. When I change it to
>
> =SUMPRODUCT(E4:E, --(YEAR(A4:A)=YEAR($B$2)), --(H4:H="Interest"))
>
> I get #NAME.
>
> Making the references absolute didn't help:
>
> =SUMPRODUCT($E:$E, --(YEAR($A:$A)=YEAR($B$2)), --($H:$H="Interest"))
>
> still gets #NUM.
>
> What am I doing wrong, and what's the solution? Thanks!
>
> --
> Stan Brown, Oak Road Systems, Tompkins County, New York, USA
> http://OakRoadSystems.com/
> "If there's one thing I know, it's men. I ought to: it's
> been my life work." -- Marie Dressler, in /Dinner at Eight/


Reply With Quote
  #6 (permalink)  
Old 01-13-2008, 07:34 PM
T. Valko
 
Posts: n/a
Re: SUMPRODUCT to test two conditions

>I have to remember to update it when transactions go below row 699:

You can't use entire columns as range references unless you're using Excel
2007.

You can either use a range large enough to allow for future entries or you
could use a dynamic range. A dynamic range would be the best choice.

http://contextures.com/xlNames01.html#Dynamic


--
Biff
Microsoft Excel MVP


"Stan Brown" <the_stan_brown@fastmail.fm> wrote in message
news:MPG.21f3de679ac9710c98b39d@news.individual.ne t...
> In my checking-account spreadsheet, I have
> A4 and below - date
> E4 and below - deposit amount
> H4 and below - comment
> B2 - today's date or as-of date
> (Rows 1 to 3 of columns A and E are just text headers, not numbers or
> formulas.)
>
> I want to summarize interest for the current year (year that matches
> B2's year, comment equals "Interest"). The following array formula
> works, but I have to remember to update it when transactions go below
> row 699:
>
> { =SUM( (YEAR(A4:A699)=YEAR(B$2))*(H4:H699="Interest")*E4: E699 ) }
>
> It seems this should be doable with a sumproduct, so I type:
>
> =SUMPRODUCT(E:E, --(YEAR(A:A)=YEAR($B$2)), --(H:H="Interest"))
>
> but I get a #NUM. When I change it to
>
> =SUMPRODUCT(E4:E, --(YEAR(A4:A)=YEAR($B$2)), --(H4:H="Interest"))
>
> I get #NAME.
>
> Making the references absolute didn't help:
>
> =SUMPRODUCT($E:$E, --(YEAR($A:$A)=YEAR($B$2)), --($H:$H="Interest"))
>
> still gets #NUM.
>
> What am I doing wrong, and what's the solution? Thanks!
>
> --
> Stan Brown, Oak Road Systems, Tompkins County, New York, USA
> http://OakRoadSystems.com/
> "If there's one thing I know, it's men. I ought to: it's
> been my life work." -- Marie Dressler, in /Dinner at Eight/



Reply With Quote
  #7 (permalink)  
Old 01-13-2008, 07:34 PM
T. Valko
 
Posts: n/a
Re: SUMPRODUCT to test two conditions

>I have to remember to update it when transactions go below row 699:

You can't use entire columns as range references unless you're using Excel
2007.

You can either use a range large enough to allow for future entries or you
could use a dynamic range. A dynamic range would be the best choice.

http://contextures.com/xlNames01.html#Dynamic


--
Biff
Microsoft Excel MVP


"Stan Brown" <the_stan_brown@fastmail.fm> wrote in message
news:MPG.21f3de679ac9710c98b39d@news.individual.ne t...
> In my checking-account spreadsheet, I have
> A4 and below - date
> E4 and below - deposit amount
> H4 and below - comment
> B2 - today's date or as-of date
> (Rows 1 to 3 of columns A and E are just text headers, not numbers or
> formulas.)
>
> I want to summarize interest for the current year (year that matches
> B2's year, comment equals "Interest"). The following array formula
> works, but I have to remember to update it when transactions go below
> row 699:
>
> { =SUM( (YEAR(A4:A699)=YEAR(B$2))*(H4:H699="Interest")*E4: E699 ) }
>
> It seems this should be doable with a sumproduct, so I type:
>
> =SUMPRODUCT(E:E, --(YEAR(A:A)=YEAR($B$2)), --(H:H="Interest"))
>
> but I get a #NUM. When I change it to
>
> =SUMPRODUCT(E4:E, --(YEAR(A4:A)=YEAR($B$2)), --(H4:H="Interest"))
>
> I get #NAME.
>
> Making the references absolute didn't help:
>
> =SUMPRODUCT($E:$E, --(YEAR($A:$A)=YEAR($B$2)), --($H:$H="Interest"))
>
> still gets #NUM.
>
> What am I doing wrong, and what's the solution? Thanks!
>
> --
> Stan Brown, Oak Road Systems, Tompkins County, New York, USA
> http://OakRoadSystems.com/
> "If there's one thing I know, it's men. I ought to: it's
> been my life work." -- Marie Dressler, in /Dinner at Eight/



Reply With Quote
  #8 (permalink)  
Old 01-13-2008, 08:39 PM
Stan Brown
 
Posts: n/a
Re: SUMPRODUCT to test two conditions

Sun, 13 Jan 2008 14:34:32 -0500 from T. Valko
<biffinpitt@comcast.net>:
> Subject: Re: SUMPRODUCT to test two conditions
> Newsgroups: microsoft.public.excel
> Date: Sun, 13 Jan 2008 14:34:32 -0500
> From: T. Valko <biffinpitt@comcast.net>
> Message-ID: <e31ASthVIHA.1188@TK2MSFTNGP04.phx.gbl>
>
> >I have to remember to update it when transactions go below row 699:

>
> You can't use entire columns as range references unless you're using Excel
> 2007.


Ah -- that was the piece I was missing. Thanks!

Any chance you can remove that "-- " signature delimiter? It's
appropriate when what follows is just signature, but since you're
posting your comments and your signature before the quoted material
that makes the whole quote get treated like part of your signature.
Newsreaders that honor the delimiter then throw away the entire
previous quote because signatures aren't supposed to be quoted.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
"If there's one thing I know, it's men. I ought to: it's
been my life work." -- Marie Dressler, in /Dinner at Eight/
Reply With Quote
  #9 (permalink)  
Old 01-13-2008, 08:39 PM
Stan Brown
 
Posts: n/a
Re: SUMPRODUCT to test two conditions

Sun, 13 Jan 2008 14:34:32 -0500 from T. Valko
<biffinpitt@comcast.net>:
> Subject: Re: SUMPRODUCT to test two conditions
> Newsgroups: microsoft.public.excel
> Date: Sun, 13 Jan 2008 14:34:32 -0500
> From: T. Valko <biffinpitt@comcast.net>
> Message-ID: <e31ASthVIHA.1188@TK2MSFTNGP04.phx.gbl>
>
> >I have to remember to update it when transactions go below row 699:

>
> You can't use entire columns as range references unless you're using Excel
> 2007.


Ah -- that was the piece I was missing. Thanks!

Any chance you can remove that "-- " signature delimiter? It's
appropriate when what follows is just signature, but since you're
posting your comments and your signature before the quoted material
that makes the whole quote get treated like part of your signature.
Newsreaders that honor the delimiter then throw away the entire
previous quote because signatures aren't supposed to be quoted.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
"If there's one thing I know, it's men. I ought to: it's
been my life work." -- Marie Dressler, in /Dinner at Eight/
Reply With Quote
  #10 (permalink)  
Old 01-13-2008, 08:40 PM
Stan Brown
 
Posts: n/a
Re: SUMPRODUCT to test two conditions

Sun, 13 Jan 2008 13:56:37 -0000 from Sandy Mann <sandymann2
@mailinator.com>:
> SUMPROUCT(), like array formulas, cannot work with whole columns. Try
> making the whole columns ranges even if it is B4:A65535 but having such a
> large range may slow your sheet down somewhat.


Thanks. I had thought about that but like you I was concerned about
performance. I didn't benchmark it, though.

T. Valko's suggestion of dynamic ranges did the trick.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
"If there's one thing I know, it's men. I ought to: it's
been my life work." -- Marie Dressler, in /Dinner at Eight/
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:56 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Credit Card | Fuente De | Personal Finance | Mortgages | Loans



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114