IF statement / SUM IF

  • Thread starter Thread starter T.R.
  • Start date Start date
T

T.R.

I have a spread sheet with the following:
In Cloum A are 4-digit division numbers,
In column B are 5-digit account numbers,
In cloumn C are values.

I am attempting to write a formula that says: If the range
in column A = 1234 and Cloumn B = 12345, then Sum the
value in Column C, if not zero.

Any help would be greatly appreciated.

Thanks.

T.R.
 
=SUMPRODUCT((A1:A15=1234)*(B1:B15=12345)*(C1:C15))

I didn't include your "if not zero" condition because if the number
is zero, it won't change the sum anyways.

Dan E
 
You will have to use an aditional colum for that, or create the sum in vba.
for the adittional colum you can enter : IF(AND(Colum A=1234;Colum B=12345);Colum C;0) then use a simple sum of the aditional colum

or you can make a macro

Dim soma as double
soma = 0
For i = first line to last line
If Cell(i,Colum A) = 1234 and Cell(i,Colum B) = 12345 then
soma = soma + Cell(i,Colum C)
end if
next i

Cell (x,y) = soma
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top