Thread: Sum if and
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff Biff is offline
external usenet poster
 
Posts: 1,688
Default Sum if and

the formulas posted will only work until you have values of 1000 or greater
in both columns A & B. Once this occurrs, the formulas will sum both
columns
A & B


Good catch. Try this:

=SUMPRODUCT(--((A2:A6=1000)+(B2:B6=1000)0),--(B2:B6<""),A2:A6)

I'm not sure what they meant about the "null". EMPTY or BLANK cells in just
column B or BOTH columns. Based on their description and expected result
they did not mean null = number 0.

Biff

"watchtower" wrote in message
...
the formulas posted will only work until you have values of 1000 or
greater
in both columns A & B. Once this occurrs, the formulas will sum both
columns
A & B. From what you wrote, it didn't seem like that was what you wanted.

Still working on fitting it into one formula... create another column, in
this case C:C, but could be anywhere
=IF(B2=1000,A2,IF(A2=0,"",IF(A2=1000,A2,""))) copy down for all your
data
and then just sum the column.


"Biff" wrote:

Try this:

column B is =1000 AND no cells must have the value null.


What does "null" mean? Do you mean EMPTY or BLANK cells?

=SUMPRODUCT(--((A2:A6=1000)+(B2:B6=1000)),--(B2:B6<""),A2:A6)

Biff

"tomjoe" wrote in message
...
I am new in here. Could someone give me a tip on how to manage this:
I have numbers in two columns (Aerea A2:B22).
In A1 I want to sum up the values in A2:A22 where the cell in column A
is
=1000 OR the corresponding cell in column B is =1000 AND no cells must
have
the value null. In the small sample under the cells in A2 + A5 + A6
meets
the
criteria and the sum in A1 is then 2650.

A B
1 2650
2 50 1500
3 0 1000
4 450 900
5 1200 850
6 1400 0

Someone have any clue ? SUMIF, SUMPRODUCT or nested if ?