Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sum where value is x [closed]

Tags:

How do you get the sum of all values of A if it has "foo" in column B? In the example below the sum should be 8.

enter image description here

like image 329
IMB Avatar asked Dec 14 '11 11:12

IMB


People also ask

How do I do a conditional sum in Excel?

If you want, you can apply the criteria to one range and sum the corresponding values in a different range. For example, the formula =SUMIF(B2:B5, "John", C2:C5) sums only the values in the range C2:C5, where the corresponding cells in the range B2:B5 equal "John."

Can I sum X's in Excel?

Excel allows us to sum all values from a table that contain both x and y by using the SUMIFS function.

How do I Sumif with two conditions?

The first step is to specify the location of the numbers: =SUMIFS(D2:D11, In other words, you want the formula to sum numbers in that column if they meet the conditions. That cell range is the first argument in this formula—the first piece of data that the function requires as input.

Can you do a Sumif with 3 criteria?

SUMIF can evaluate just one condition at a time while SUMIFS can check for multiple criteria. Syntax. With SUMIF, the sum_range is the last and optional argument - if not defined, the values in the range argument are summed.


2 Answers

try this

=SUMIF(B:B,"foo",A:A)

like image 104
brettdj Avatar answered Oct 10 '22 03:10

brettdj


If you want to sum a range of cell, as in your example:

=SUMIF(B1:B5, "foo", A1:A5) 

Syntax: SUMIF(range, criteria, sum_range)

like image 23
stivlo Avatar answered Oct 10 '22 05:10

stivlo