ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Using multiple criterie in one column to sum another column (https://www.excelbanter.com/excel-discussion-misc-queries/95453-using-multiple-criterie-one-column-sum-another-column.html)

Asa_johannesen

Using multiple criterie in one column to sum another column
 
I would like to add data in column A by criteria from column B. Both columns
contain numbers and I want two criteria from column B (I think). I Basically
what I want is to say that if the numbers in column B are between 4 and 10
(including 10 and not 4) I want the sum of the corresponding numbers in
column A. Is this making sense? So if column A had 2,2,2,4,6,3,1,7,3,2 and
column B had 12,4,2,6,10,3,5,17,9,4 I would want the result to be 14. I have
tried many variations of sum.if and sumproduct and so on and nothing seems to
work. I either get an error message saying that there is a flaw in the
formula (it doesn't like the "," I use to separate things with and so on) or
I get a return of "0". Can anyone tell me what I am supposed to do?

excelent

Using multiple criterie in one column to sum another column
 
=SUMPRODUCT((B1:B10=5)*(B1:B10<=10)*(A1:A10))

Asa_johannesen

Using multiple criterie in one column to sum another column
 
Cool. Thank you. I also managed to get it to work using :

{=SUM(HVIS(B1:B10=5;HVIS(B1:B10<=10;A1:A10;0);0)) }

Your way is easier though ;-)

This is in Danish so HVIS is IF. Otherwise I think it's written the same way.

"excelent" skrev:

=SUMPRODUCT((B1:B10=5)*(B1:B10<=10)*(A1:A10))


excelent

Using multiple criterie in one column to sum another column
 
kunne tyde på du har en dansk version :-) well done


Asa_johannesen

Using multiple criterie in one column to sum another column
 
Ja det har jeg jo nok hvilket gør det besværligt at spørge på engelsk da ting
ikke hedder det samme. Jeg startede nemlig med guiden til betinget sum
(tilføjelsesprogrammet), men den sagde bare run time error 1004 Kan ikke
angive egenskaben FormulaArray for klassen Range. Jeg tror det er fordi jeg
har for meget data. Det var med guiden jeg fandt matrix formelen ved at lave
en lille tabel med data til at bruge guiden på. :)

"excelent" skrev:

kunne tyde på du har en dansk version :-) well done



All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com