Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
conditionals statements | Excel Worksheet Functions | |||
conditionals formulas | Excel Worksheet Functions | |||
Hep with Conditionals actions please. | Excel Worksheet Functions | |||
Conditionals containing variables | Excel Discussion (Misc queries) | |||
Conditionals | Excel Worksheet Functions |