Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default sumproduct and conditionals

hi all

i am trying to combine to sumproduct statements

they are

=Sumproduct((mid(codes,1,2)="DI")*(Types="Sample") )
which works
and
=Sumproduct((mid(codes,1,2)="GB")*(Types="Sample") )
which also works

i tried using
=SUMPRODUCT((OR(MID(Codes,1,2)="DI",MID(Codes,1,2) ="GB"))*(Types="Sample"))
but that returns a 0, not the 1 it should (or i thought it should)

any suggestions?

tia

J
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default sumproduct and conditionals

apparently it only works as
=Or(Sumproduct(),Sumproduct())


"Gixxer_J_97" wrote:

hi all

i am trying to combine to sumproduct statements

they are

=Sumproduct((mid(codes,1,2)="DI")*(Types="Sample") )
which works
and
=Sumproduct((mid(codes,1,2)="GB")*(Types="Sample") )
which also works

i tried using
=SUMPRODUCT((OR(MID(Codes,1,2)="DI",MID(Codes,1,2) ="GB"))*(Types="Sample"))
but that returns a 0, not the 1 it should (or i thought it should)

any suggestions?

tia

J

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default sumproduct and conditionals

J,

OR can be done using Addition:

=SUMPRODUCT(((MID(Codes,1,2)="DI")+(MID(Codes,1,2) ="GB"))*(Types="Sample"))

HTH,
Bernie
MS Excel MVP


"Gixxer_J_97" wrote in message
...
hi all

i am trying to combine to sumproduct statements

they are

=Sumproduct((mid(codes,1,2)="DI")*(Types="Sample") )
which works
and
=Sumproduct((mid(codes,1,2)="GB")*(Types="Sample") )
which also works

i tried using

=SUMPRODUCT((OR(MID(Codes,1,2)="DI",MID(Codes,1,2) ="GB"))*(Types="Sample"))
but that returns a 0, not the 1 it should (or i thought it should)

any suggestions?

tia

J



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default sumproduct and conditionals

Hi Bernie,

I had tried that before, and the result is 2 - i was looking to have a 0 or
1 to use as a True/False

but it would work if i were to specify the result of this logical 0

thanks!

J


"Bernie Deitrick" wrote:

J,

OR can be done using Addition:

=SUMPRODUCT(((MID(Codes,1,2)="DI")+(MID(Codes,1,2) ="GB"))*(Types="Sample"))

HTH,
Bernie
MS Excel MVP


"Gixxer_J_97" wrote in message
...
hi all

i am trying to combine to sumproduct statements

they are

=Sumproduct((mid(codes,1,2)="DI")*(Types="Sample") )
which works
and
=Sumproduct((mid(codes,1,2)="GB")*(Types="Sample") )
which also works

i tried using

=SUMPRODUCT((OR(MID(Codes,1,2)="DI",MID(Codes,1,2) ="GB"))*(Types="Sample"))
but that returns a 0, not the 1 it should (or i thought it should)

any suggestions?

tia

J




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default sumproduct and conditionals

the result is actually the count of instances of DI/Sample and GB/Sample
- it'll actually come in useful for another section of my program.

thanks again!

J

"Bernie Deitrick" wrote:

J,

OR can be done using Addition:

=SUMPRODUCT(((MID(Codes,1,2)="DI")+(MID(Codes,1,2) ="GB"))*(Types="Sample"))

HTH,
Bernie
MS Excel MVP


"Gixxer_J_97" wrote in message
...
hi all

i am trying to combine to sumproduct statements

they are

=Sumproduct((mid(codes,1,2)="DI")*(Types="Sample") )
which works
and
=Sumproduct((mid(codes,1,2)="GB")*(Types="Sample") )
which also works

i tried using

=SUMPRODUCT((OR(MID(Codes,1,2)="DI",MID(Codes,1,2) ="GB"))*(Types="Sample"))
but that returns a 0, not the 1 it should (or i thought it should)

any suggestions?

tia

J






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default sumproduct and conditionals

=SUMPRODUCT((MID(codes,1,2)={"DI","GB"})*(Types="S ample"))

--
HTH

Bob Phillips

"Gixxer_J_97" wrote in message
...
hi all

i am trying to combine to sumproduct statements

they are

=Sumproduct((mid(codes,1,2)="DI")*(Types="Sample") )
which works
and
=Sumproduct((mid(codes,1,2)="GB")*(Types="Sample") )
which also works

i tried using

=SUMPRODUCT((OR(MID(Codes,1,2)="DI",MID(Codes,1,2) ="GB"))*(Types="Sample"))
but that returns a 0, not the 1 it should (or i thought it should)

any suggestions?

tia

J



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default sumproduct and conditionals

=N(SUMPRODUCT((MID(codes,1,2)={"DI","GB"})*(Types= "Sample"))0)

--
HTH

Bob Phillips

"Gixxer_J_97" wrote in message
...
Hi Bernie,

I had tried that before, and the result is 2 - i was looking to have a 0

or
1 to use as a True/False

but it would work if i were to specify the result of this logical 0

thanks!

J


"Bernie Deitrick" wrote:

J,

OR can be done using Addition:


=SUMPRODUCT(((MID(Codes,1,2)="DI")+(MID(Codes,1,2) ="GB"))*(Types="Sample"))

HTH,
Bernie
MS Excel MVP


"Gixxer_J_97" wrote in message
...
hi all

i am trying to combine to sumproduct statements

they are

=Sumproduct((mid(codes,1,2)="DI")*(Types="Sample") )
which works
and
=Sumproduct((mid(codes,1,2)="GB")*(Types="Sample") )
which also works

i tried using


=SUMPRODUCT((OR(MID(Codes,1,2)="DI",MID(Codes,1,2) ="GB"))*(Types="Sample"))
but that returns a 0, not the 1 it should (or i thought it should)

any suggestions?

tia

J






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default sumproduct and conditionals

That works!

Thanks Bob!

J

"Bob Phillips" wrote:

=SUMPRODUCT((MID(codes,1,2)={"DI","GB"})*(Types="S ample"))

--
HTH

Bob Phillips

"Gixxer_J_97" wrote in message
...
hi all

i am trying to combine to sumproduct statements

they are

=Sumproduct((mid(codes,1,2)="DI")*(Types="Sample") )
which works
and
=Sumproduct((mid(codes,1,2)="GB")*(Types="Sample") )
which also works

i tried using

=SUMPRODUCT((OR(MID(Codes,1,2)="DI",MID(Codes,1,2) ="GB"))*(Types="Sample"))
but that returns a 0, not the 1 it should (or i thought it should)

any suggestions?

tia

J




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default sumproduct and conditionals

Now you confuse me, it gives the same result as Bernie's?

--
HTH

Bob Phillips

"Gixxer_J_97" wrote in message
...
That works!

Thanks Bob!

J

"Bob Phillips" wrote:

=SUMPRODUCT((MID(codes,1,2)={"DI","GB"})*(Types="S ample"))

--
HTH

Bob Phillips

"Gixxer_J_97" wrote in message
...
hi all

i am trying to combine to sumproduct statements

they are

=Sumproduct((mid(codes,1,2)="DI")*(Types="Sample") )
which works
and
=Sumproduct((mid(codes,1,2)="GB")*(Types="Sample") )
which also works

i tried using


=SUMPRODUCT((OR(MID(Codes,1,2)="DI",MID(Codes,1,2) ="GB"))*(Types="Sample"))
but that returns a 0, not the 1 it should (or i thought it should)

any suggestions?

tia

J






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditionals statements out0015 Excel Worksheet Functions 10 July 7th 09 09:54 PM
conditionals formulas out0015 Excel Worksheet Functions 2 July 6th 09 05:46 PM
Hep with Conditionals actions please. Mark Excel Worksheet Functions 2 February 8th 09 04:02 PM
Conditionals containing variables ChevyChem Excel Discussion (Misc queries) 8 October 18th 08 02:34 AM
Conditionals Salvador EnrĂ­quez M Excel Worksheet Functions 1 April 18th 06 10:15 PM


All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"