View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default SUMIF with two conditions (or)

Try this:

=SUMPRODUCT((A2:A24="01")+(B2:B24="01"),C2:C24)

or you could put the 01 in a cell (D2?) and make it:

=SUMPRODUCT((A2:A24=D2)+(B2:B24=D2),C2:C24)

Hope this helps.

Pete

On Nov 11, 1:04 am, wrote:
Hello, so far I haven't found a discussion about my specific problem.

I have a worksheet with different patient samples. Two columns (A and
B) specify the HLA alleles of the patient (lets say 01, 02, 03, 04,
etc.), another column (C) specifies the magnitude of a serum marker
(for example 340, 4350 or 1230).

I now want to add up the serum marker quantities if the patient is
lets say HLA 01, that means if column 1 OR column two say "01".

I put in a function like this

=SUMIF(A2:B24,"01",C2:C24)

but it doesn't bring back correct results. SUMPRODUCT obviously doesnt
work because I want the OR logic, so a Patient with the HLA type 01/02
would be counted just like a patient with 01/01. Understandable?