Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default conditional sum(if) data matching two (or more) separated columns

How do I collect a sum with the following conditions(?):
If A:A = "AAA"
If D:D = "XXX"
then sum of all "XXX" that also are "AAA" (i.e., appear in the same row as
"AAA")

Along the same lines consider also:
If A:A = "AAA" and,
If C:C = "BBB" and,
If D:D= "XXX" then,
sum of all "XXX" that are also "AAA" and "BBB" when "AAA" and "BBB" appear
in the same row with "XXX"

Thanks Jim
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default conditional sum(if) data matching two (or more) separated columns

Try,

=SUMPRODUCT((A1:A20000="XXX")*(D1:D20000="XXX"))

and

=SUMPRODUCT((A1:A20000="XXX")*(C1:C20000="BBB")*(D 1:D20000="XXX"))

You can't use full columns

Mike


"psalm91jim" wrote:

How do I collect a sum with the following conditions(?):
If A:A = "AAA"
If D:D = "XXX"
then sum of all "XXX" that also are "AAA" (i.e., appear in the same row as
"AAA")

Along the same lines consider also:
If A:A = "AAA" and,
If C:C = "BBB" and,
If D:D= "XXX" then,
sum of all "XXX" that are also "AAA" and "BBB" when "AAA" and "BBB" appear
in the same row with "XXX"

Thanks Jim

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default conditional sum(if) data matching two (or more) separated columns

Do you want a COUNT or a SUM?

Your description sounds like a COUNT.

=SUMPRODUCT(--(A1:A10="AAA"),--(D1:D10="XXX"))

=SUMPRODUCT(--(A1:A10="AAA"),--(C1:C10="BBB"),--(D1:D10="XXX"))

Better to use cells to hold the criteria:

X1 = AAA
X2 = BBB
X3 = XXX

=SUMPRODUCT(--(A1:A10=X1),--(D1:D10=X3))

=SUMPRODUCT(--(A1:A10=X1),--(C1:C10=X2),--(D1:D10=X3))

--
Biff
Microsoft Excel MVP


"psalm91jim" wrote in message
...
How do I collect a sum with the following conditions(?):
If A:A = "AAA"
If D:D = "XXX"
then sum of all "XXX" that also are "AAA" (i.e., appear in the same row as
"AAA")

Along the same lines consider also:
If A:A = "AAA" and,
If C:C = "BBB" and,
If D:D= "XXX" then,
sum of all "XXX" that are also "AAA" and "BBB" when "AAA" and "BBB" appear
in the same row with "XXX"

Thanks Jim



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default conditional sum(if) data matching two (or more) separated colu



"Roger Govier" wrote:

Hi Jim

=SUMPRODUCT(--(A1:A1000)="AAA"),--(C1:C1000="BBB"),--(D1:D1000="XXX"))

--
Regards
Roger Govier

"psalm91jim" wrote in message
...
How do I collect a sum with the following conditions(?):
If A:A = "AAA"
If D:D = "XXX"
then sum of all "XXX" that also are "AAA" (i.e., appear in the same row as
"AAA")

Along the same lines consider also:
If A:A = "AAA" and,
If C:C = "BBB" and,
If D:D= "XXX" then,
sum of all "XXX" that are also "AAA" and "BBB" when "AAA" and "BBB" appear
in the same row with "XXX"

Thanks Jim


Thanks for your quick response Roger but that formula generated for me #NUM.
Perhaps I was not clear in describing the scenario. Let me try to show it a
different way:

Out of a possible 200+ columns of data on patients, I want to find how many
patients meet the following criteria: How many patients that are Pulmonary
consults were treated in a timely manner while in ICU.

One of the columns contains which service referred the consult. For
instance, column AI lists by patient who referred the consult: Cardiology,
Oncology, Pulmonary, etc., as text data. Another column (BB), contains text
data which describes how timely medical attention was received by patient:
Some/Timely,
Full/Timely, Minimal, etc. And finally another column (GH) contains text
data which describes in what department the patients first were seen: ICU,
PCU, Nursing Floor, etc. Each of these columns may have the possibility of
being answered by one of 4-20 responses (depending on what the column is
requiring within the parameters set for the appropriated--and only--answer).

From the three columns I want to find the number of patients that meet the
following condition: AI="Pulmonary"; BB="Full/Timely"; and GH="ICU".

The answer should reveal a sum of patient meeting those conditions from a
pool of all patients seen in a fiscal year. For instance, though I may have
seen 1500 patients in Fiscal Year 2008 (each row is a different patient),
only 45 met the conditions stated above: They were referred to my department
by "pulmonary" MD, their symptoms were addressed in a "full/timely" manner
while they were in the care of the "ICU" department.

I have created a number of charts that track compilation of data from the
large fiscal year spreed sheet and this formula is for one item in a
particular chart.

I appreciate your help. For the past few years I have attempted to find an
answer to this query but have been unable to. Looked in various help books
but nothing seems to address this particular conditional need (or at least I
have been unable to find it).

Thanks for your kind help
Jim Bowers (psalm91jim)
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default conditional sum(if) data matching two (or more) separated colu

Hi Jim

That should have produce a correct result provided your data is OK.
You would have needed to make the ranges fit your requirement, (you cannot
use whole columns) and each range would have to have the same dimensions.
Post back with the actual formula you used.

if you are still having difficulties, mail me a copy of the workbook direct
and I will take a look.
To send direct
roger at technology4u dot co dot uk
Change the at and dots to make a valid email address,

--
Regards
Roger Govier

"psalm91jim" wrote in message
...


"Roger Govier" wrote:

Hi Jim

=SUMPRODUCT(--(A1:A1000)="AAA"),--(C1:C1000="BBB"),--(D1:D1000="XXX"))

--
Regards
Roger Govier

"psalm91jim" wrote in message
...
How do I collect a sum with the following conditions(?):
If A:A = "AAA"
If D:D = "XXX"
then sum of all "XXX" that also are "AAA" (i.e., appear in the same row
as
"AAA")

Along the same lines consider also:
If A:A = "AAA" and,
If C:C = "BBB" and,
If D:D= "XXX" then,
sum of all "XXX" that are also "AAA" and "BBB" when "AAA" and "BBB"
appear
in the same row with "XXX"

Thanks Jim


Thanks for your quick response Roger but that formula generated for me
#NUM.
Perhaps I was not clear in describing the scenario. Let me try to show it
a
different way:

Out of a possible 200+ columns of data on patients, I want to find how
many
patients meet the following criteria: How many patients that are Pulmonary
consults were treated in a timely manner while in ICU.

One of the columns contains which service referred the consult. For
instance, column AI lists by patient who referred the consult: Cardiology,
Oncology, Pulmonary, etc., as text data. Another column (BB), contains
text
data which describes how timely medical attention was received by patient:
Some/Timely,
Full/Timely, Minimal, etc. And finally another column (GH) contains text
data which describes in what department the patients first were seen: ICU,
PCU, Nursing Floor, etc. Each of these columns may have the possibility of
being answered by one of 4-20 responses (depending on what the column is
requiring within the parameters set for the appropriated--and
only--answer).

From the three columns I want to find the number of patients that meet the
following condition: AI="Pulmonary"; BB="Full/Timely"; and GH="ICU".

The answer should reveal a sum of patient meeting those conditions from a
pool of all patients seen in a fiscal year. For instance, though I may
have
seen 1500 patients in Fiscal Year 2008 (each row is a different patient),
only 45 met the conditions stated above: They were referred to my
department
by "pulmonary" MD, their symptoms were addressed in a "full/timely" manner
while they were in the care of the "ICU" department.

I have created a number of charts that track compilation of data from the
large fiscal year spreed sheet and this formula is for one item in a
particular chart.

I appreciate your help. For the past few years I have attempted to find an
answer to this query but have been unable to. Looked in various help books
but nothing seems to address this particular conditional need (or at least
I
have been unable to find it).

Thanks for your kind help
Jim Bowers (psalm91jim)


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
matching 2 columns of data karen Excel Discussion (Misc queries) 3 May 9th 07 03:15 PM
Conditional sum matching two columns and a row ~L Excel Worksheet Functions 9 September 26th 06 07:28 PM
Matching two columns and their data [email protected] Excel Worksheet Functions 2 March 6th 06 08:17 PM
Matching Data in Columns ebraun01 Excel Worksheet Functions 7 January 14th 06 02:35 AM
Matching data from 2 columns doohen Excel Worksheet Functions 12 December 22nd 05 07:05 PM


All times are GMT +1. The time now is 12:42 AM.

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

About Us

"It's about Microsoft Excel"