The Code Cage - Microsoft Office help Free Microsoft Office Help for all Applications!
Technical Support
Satellite TV Deal
 

To stop seeing these ads and get other benefits check This page!

Go Back   The Code Cage Forums > Newsgroups - Microsoft Topics > Newsgroup - Excel Forum > Worksheet Functions

Custom Search
Translate this Page!
Chat In Use Now! Microsoft Office Chat Online now!


Worksheet Functions Post questions in this forum if they are related to using Microsoft Excel Worksheet Functions, e.g Forumale or built in functionality etc.

Hey there!

It looks like you're enjoying but haven't created an account yet. Why not take a minute to register for your own free account now? As a member you get free access to all of our forums and posts plus the ability to post your own messages, communicate directly with other members and much more. Register now!

Already a member? Login at the top of this page to stop seeing this message.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2nd March 2010, 12:05 PM
Diddy
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Sumproduct neither nor

------ Register to get rid of these "In Post" ads! ------


Hi everyone,

I've been using
=SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875="N1")+(Data!$K$3:$K$9875="N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
but now as part of the checking of the workbook I want a count of the
opposite where column K does not = N1 or N2.

I'm doing it the clunky way and using + every other value that K can hold
(numeric and alphanumeric) but there are a lot more of them than the N1, N2
so it would be much neater just to be able to say neither, nor

I've tried this but it returns an unexpected number
=SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875<>"N1")+(Data!$K$3:$K$9875<>"N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))

Where am I going wrong?

Many thanks
Diddy
Reply to this post


Did you find this post helpful? Yes | No

The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #2 (permalink)  
Old 2nd March 2010, 12:29 PM
Joe User
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default RE: Sumproduct neither nor

------ Register to get rid of these "In Post" ads! ------


"Diddy" wrote:
> I've been using
> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),
> --((Data!$K$3:$K$9875="N1")+
> (Data!$K$3:$K$9875="N2")),
> --((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
> but now as part of the checking of the workbook I want a count of the
> opposite where column K does not = N1 or N2.


Try:

=SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),
--((Data!$K$3:$K$9875="N1")+
(Data!$K$3:$K$9875="N2")=0),
((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))

Note that I eliminated some superfluous double-negation. In fact, you can
remove them all with the following:

=SUMPRODUCT((Data!$C$3:$C$9875=$A5)*
((Data!$K$3:$K$9875="N1")+
(Data!$K$3:$K$9875="N2")=0)*
((Data!$AC$3:$AC$9875={"c","m"})))

Note the simplication in the last term. I threw that in for demonstration
purposes only. Similarly, you could have written
Data!$K$3:$K$9875={"N1","N2"} in the first place, i.e. when you want to count
when column K is "N1" or "N2". However, that does make it difficult to
modify the formula to count when column K is neither "N1" nor "N2".


----- original message -----

"Diddy" wrote:
> Hi everyone,
>
> I've been using
> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875="N1")+(Data!$K$3:$K$9875="N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
> but now as part of the checking of the workbook I want a count of the
> opposite where column K does not = N1 or N2.
>
> I'm doing it the clunky way and using + every other value that K can hold
> (numeric and alphanumeric) but there are a lot more of them than the N1, N2
> so it would be much neater just to be able to say neither, nor
>
> I've tried this but it returns an unexpected number
> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875<>"N1")+(Data!$K$3:$K$9875<>"N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
>
> Where am I going wrong?
>
> Many thanks
> Diddy

Reply to this post


Did you find this post helpful? Yes | No
  #3 (permalink)  
Old 2nd March 2010, 12:43 PM
Diddy
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default RE: Sumproduct neither nor

------ Register to get rid of these "In Post" ads! ------


Thank you Joe User :-)

"Joe User" wrote:

> "Diddy" wrote:
> > I've been using
> > =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),
> > --((Data!$K$3:$K$9875="N1")+
> > (Data!$K$3:$K$9875="N2")),
> > --((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
> > but now as part of the checking of the workbook I want a count of the
> > opposite where column K does not = N1 or N2.

>
> Try:
>
> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),
> --((Data!$K$3:$K$9875="N1")+
> (Data!$K$3:$K$9875="N2")=0),
> ((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
>
> Note that I eliminated some superfluous double-negation. In fact, you can
> remove them all with the following:
>
> =SUMPRODUCT((Data!$C$3:$C$9875=$A5)*
> ((Data!$K$3:$K$9875="N1")+
> (Data!$K$3:$K$9875="N2")=0)*
> ((Data!$AC$3:$AC$9875={"c","m"})))
>
> Note the simplication in the last term. I threw that in for demonstration
> purposes only. Similarly, you could have written
> Data!$K$3:$K$9875={"N1","N2"} in the first place, i.e. when you want to count
> when column K is "N1" or "N2". However, that does make it difficult to
> modify the formula to count when column K is neither "N1" nor "N2".
>
>
> ----- original message -----
>
> "Diddy" wrote:
> > Hi everyone,
> >
> > I've been using
> > =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875="N1")+(Data!$K$3:$K$9875="N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
> > but now as part of the checking of the workbook I want a count of the
> > opposite where column K does not = N1 or N2.
> >
> > I'm doing it the clunky way and using + every other value that K can hold
> > (numeric and alphanumeric) but there are a lot more of them than the N1, N2
> > so it would be much neater just to be able to say neither, nor
> >
> > I've tried this but it returns an unexpected number
> > =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875<>"N1")+(Data!$K$3:$K$9875<>"N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
> >
> > Where am I going wrong?
> >
> > Many thanks
> > Diddy

Reply to this post


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #4 (permalink)  
Old 2nd March 2010, 07:53 PM
T. Valko
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: Sumproduct neither nor

------ Register to get rid of these "In Post" ads! ------


Try this...

=SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--(ISNA(MATCH(Data!$K$3:$K$9875,{"N1","N2"},0))),--(ISNUMBER(MATCH(Data!$AC$3:$AC$9875,{"c","m"},0))))

--
Biff
Microsoft Excel MVP


"Diddy" <Diddy@discussions.microsoft.com> wrote in message
news:421B6D30-18DC-49B5-8A8B-051ACF03B6BD@microsoft.com...
> Hi everyone,
>
> I've been using
> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875="N1")+(Data!$K$3:$K$9875="N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
> but now as part of the checking of the workbook I want a count of the
> opposite where column K does not = N1 or N2.
>
> I'm doing it the clunky way and using + every other value that K can hold
> (numeric and alphanumeric) but there are a lot more of them than the N1,
> N2
> so it would be much neater just to be able to say neither, nor
>
> I've tried this but it returns an unexpected number
> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875<>"N1")+(Data!$K$3:$K$9875<>"N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
>
> Where am I going wrong?
>
> Many thanks
> Diddy



Reply to this post


Did you find this post helpful? Yes | No
  #5 (permalink)  
Old 2nd March 2010, 11:00 PM
David Biddulph
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: Sumproduct neither nor

------ Register to get rid of these "In Post" ads! ------


=SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--(Data!$K$3:$K$9875<>"N1"),--(Data!$K$3:$K$9875<>"N2"),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))

Remember your Boolean Algebra:
NOT(OR(A,B)) = AND(NOT(A),NOT(B))
--
David Biddulph


"Diddy" <Diddy@discussions.microsoft.com> wrote in message
news:421B6D30-18DC-49B5-8A8B-051ACF03B6BD@microsoft.com...
> Hi everyone,
>
> I've been using
> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875="N1")+(Data!$K$3:$K$9875="N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
> but now as part of the checking of the workbook I want a count of the
> opposite where column K does not = N1 or N2.
>
> I'm doing it the clunky way and using + every other value that K can hold
> (numeric and alphanumeric) but there are a lot more of them than the N1,
> N2
> so it would be much neater just to be able to say neither, nor
>
> I've tried this but it returns an unexpected number
> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875<>"N1")+(Data!$K$3:$K$9875<>"N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
>
> Where am I going wrong?
>
> Many thanks
> Diddy



Reply to this post


Did you find this post helpful? Yes | No
  #6 (permalink)  
Old 2nd March 2010, 11:19 PM
T. Valko
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: Sumproduct neither nor

------ Register to get rid of these "In Post" ads! ------


--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m"))

No need for the double unary in this application.

(Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")

--
Biff
Microsoft Excel MVP


"David Biddulph" <groups [at] biddulph.org.uk> wrote in message
news:kYCdnZkYDMgTChDWnZ2dnUVZ8kmdnZ2d@bt.com...
> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--(Data!$K$3:$K$9875<>"N1"),--(Data!$K$3:$K$9875<>"N2"),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
>
> Remember your Boolean Algebra:
> NOT(OR(A,B)) = AND(NOT(A),NOT(B))
> --
> David Biddulph
>
>
> "Diddy" <Diddy@discussions.microsoft.com> wrote in message
> news:421B6D30-18DC-49B5-8A8B-051ACF03B6BD@microsoft.com...
>> Hi everyone,
>>
>> I've been using
>> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875="N1")+(Data!$K$3:$K$9875="N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
>> but now as part of the checking of the workbook I want a count of the
>> opposite where column K does not = N1 or N2.
>>
>> I'm doing it the clunky way and using + every other value that K can hold
>> (numeric and alphanumeric) but there are a lot more of them than the N1,
>> N2
>> so it would be much neater just to be able to say neither, nor
>>
>> I've tried this but it returns an unexpected number
>> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875<>"N1")+(Data!$K$3:$K$9875<>"N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
>>
>> Where am I going wrong?
>>
>> Many thanks
>> Diddy

>
>



Reply to this post


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #7 (permalink)  
Old 2nd March 2010, 11:35 PM
David Biddulph
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: Sumproduct neither nor

------ Register to get rid of these "In Post" ads! ------


True. I copied that part without reading it. Well spotted!
--
David Biddulph


"T. Valko" <biffinpitt@comcast.net> wrote in message
news:OgyWW5luKHA.1796@TK2MSFTNGP02.phx.gbl...
> --((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m"))
>
> No need for the double unary in this application.
>
> (Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")
>
> --
> Biff
> Microsoft Excel MVP
>
>
> "David Biddulph" <groups [at] biddulph.org.uk> wrote in message
> news:kYCdnZkYDMgTChDWnZ2dnUVZ8kmdnZ2d@bt.com...
>> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--(Data!$K$3:$K$9875<>"N1"),--(Data!$K$3:$K$9875<>"N2"),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
>>
>> Remember your Boolean Algebra:
>> NOT(OR(A,B)) = AND(NOT(A),NOT(B))
>> --
>> David Biddulph
>>
>>
>> "Diddy" <Diddy@discussions.microsoft.com> wrote in message
>> news:421B6D30-18DC-49B5-8A8B-051ACF03B6BD@microsoft.com...
>>> Hi everyone,
>>>
>>> I've been using
>>> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875="N1")+(Data!$K$3:$K$9875="N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
>>> but now as part of the checking of the workbook I want a count of the
>>> opposite where column K does not = N1 or N2.
>>>
>>> I'm doing it the clunky way and using + every other value that K can
>>> hold
>>> (numeric and alphanumeric) but there are a lot more of them than the N1,
>>> N2
>>> so it would be much neater just to be able to say neither, nor
>>>
>>> I've tried this but it returns an unexpected number
>>> =SUMPRODUCT(--(Data!$C$3:$C$9875=$A5),--((Data!$K$3:$K$9875<>"N1")+(Data!$K$3:$K$9875<>"N2")),--((Data!$AC$3:$AC$9875="c")+(Data!$AC$3:$AC$9875="m")))
>>>
>>> Where am I going wrong?
>>>
>>> Many thanks
>>> Diddy

>>
>>

>
>


Reply to this post


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
Reply

Bookmarks

Tags
sumproduct


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

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

Forum Jump

The Code Cage Affilliates


To stop seeing these ads and get other benefits check This page!



All times are GMT +1. The time now is 01:38 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.5.0
No part of this board may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!
All MS office icons are registered trademarks of the application the represent