ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   SumIF-multiple conditions/OR (https://www.excelbanter.com/new-users-excel/187300-sumif-multiple-conditions.html)

Garyw

SumIF-multiple conditions/OR
 
I have a range of cells that I want to ck for a "Y", then in the next range
can be "STOP" or a value of "Go"? Kinda a mix of conditions.

Don Guillett

SumIF-multiple conditions/OR
 
A bit more detail, perhaps.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"GaryW" wrote in message
...
I have a range of cells that I want to ck for a "Y", then in the next range
can be "STOP" or a value of "Go"? Kinda a mix of conditions.



Garyw

SumIF-multiple conditions/OR
 


"Don Guillett" wrote:

A bit more detail, perhaps.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"GaryW" wrote in message
...
I have a range of cells that I want to ck for a "Y", then in the next range
can be "STOP" or a value of "Go"? Kinda a mix of conditions.


Example:

A B C
N Run 100
N Pause 50
Y Stop 50
C exit 25
Y Go 10
Z Exec 20

So I need to only select those row w/"Y" AND column B can be one of two values
STOP or Go. I will sum the values in Col C. THX.


Max

SumIF-multiple conditions/OR
 
You could get by with something like this in say, D1:
=SUMPRODUCT((A1:A6="Y")*(ISNUMBER(MATCH(B1:B6,{"Go ","Stop"},0)))*C1:C6)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"GaryW" wrote:
A B C
N Run 100
N Pause 50
Y Stop 50
C exit 25
Y Go 10
Z Exec 20

So I need to only select those row w/"Y" AND column B can be one of two values
STOP or Go. I will sum the values in Col C. THX.


Garyw

SumIF-multiple conditions/OR
 
Does not appear to find the string values, "Go,Stop"....they are in the file.
Does the ISNUMBER expect a numeric value or can it be a string? Many Thanks.

"Max" wrote:

You could get by with something like this in say, D1:
=SUMPRODUCT((A1:A6="Y")*(ISNUMBER(MATCH(B1:B6,{"Go ","Stop"},0)))*C1:C6)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"GaryW" wrote:
A B C
N Run 100
N Pause 50
Y Stop 50
C exit 25
Y Go 10
Z Exec 20

So I need to only select those row w/"Y" AND column B can be one of two values
STOP or Go. I will sum the values in Col C. THX.


Robert McCurdy

SumIF-multiple conditions/OR
 
=Sumproduct(--(RngA="Y")*(RngB={"Stop","Go"})*RngC)


Regards
Robert McCurdy
"GaryW" wrote in message ...


"Don Guillett" wrote:

A bit more detail, perhaps.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"GaryW" wrote in message
...
I have a range of cells that I want to ck for a "Y", then in the next range
can be "STOP" or a value of "Go"? Kinda a mix of conditions.


Example:

A B C
N Run 100
N Pause 50
Y Stop 50
C exit 25
Y Go 10
Z Exec 20

So I need to only select those row w/"Y" AND column B can be one of two values
STOP or Go. I will sum the values in Col C. THX.


Max

SumIF-multiple conditions/OR
 
Does not appear to find the string values, "Go,Stop"....they are in the
file.
Does the ISNUMBER expect a numeric value or can it be a string?


There could be extraneous white leading/trailing spaces in col B's data
throwing some apparent matches off. Try it with a TRIM to enhance matching,
viz.:
=SUMPRODUCT((A1:A6="Y")*(ISNUMBER(MATCH(TRIM(B1:B6 ),{"Go","Stop"},0)))*C1:C6)

ISNUMBER merely converts the matched array retuned into an array of
TRUEs/FALSEs, depending on whether the elements are numeric or non-numeric
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


Garyw

SumIF-multiple conditions/OR
 
Thanks to All, Don/Max & Robert. Your solutions all worked and your effort
to send a reply is greatly appreciated.

"Robert McCurdy" wrote:

=Sumproduct(--(RngA="Y")*(RngB={"Stop","Go"})*RngC)


Regards
Robert McCurdy
"GaryW" wrote in message ...


"Don Guillett" wrote:

A bit more detail, perhaps.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"GaryW" wrote in message
...
I have a range of cells that I want to ck for a "Y", then in the next range
can be "STOP" or a value of "Go"? Kinda a mix of conditions.

Example:

A B C
N Run 100
N Pause 50
Y Stop 50
C exit 25
Y Go 10
Z Exec 20

So I need to only select those row w/"Y" AND column B can be one of two values
STOP or Go. I will sum the values in Col C. THX.




All times are GMT +1. The time now is 06:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com