View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Squeaky Squeaky is offline
external usenet poster
 
Posts: 155
Default SUMIF based on several criteria.

Hi Mike,

Assuming your data starts in A2, B2, C2, and runs down. In D2 (or any column
on row 2) paste:

=IF(AND(IF(A2=0,(B2+C2)/2,A2)100,OR(B2<90,C2<90)),100,IF(A2=0,(B2+C2)/2,A2))+IF(AND(IF(B2=0,(C2+A2)/2,B2)100,OR(C2<90,A2<90)),100,IF(B2=0,(C2+A2)/2,B2))+IF(AND(IF(C2=0,(A2+B2)/2,C2)100,OR(A2<90,B2<90)),100,IF(C2=0,(A2+B2)/2,C2))

Then drag/copy it down as far as you need.

Cheers.

Squeaky

"Mike" wrote:

OK here is what I want to do. I have three different values that I want to
sum. I have several criteria that I have to consider when I sum them.

A B C D Sum Total
89 90 105
100 100 110
75 0 85
75 65 0 Go
65 75 0 No/Go

OK so here is a sample set of values. I want to sum the values from left to
right. For the majority of my totals I will only need to do a straight
sum(A,B,C) no big deal. However from time to time as in the first example
where run into a qualification.
Problem 1. If any of the three values are under 90 and any of the other
values are over 100 I need to round the value over 100 down to 100.

Problem 2. If any of the the values are a 0 then I need to be able in the
same cell average the other 2 number and then add the three values together.

I have tried to use nested If statments, looked at SUMIFS and SUMIF but the
SUMIFs only will do it if I have a range not individual cells to sum.

Ideas?

Thanks in advance.

Mike