Sum Values in One Range Based on Criteria in Another
I have a simple spreadsheet, two columns "Amount" (col Q) and "Account" (col O). I want to get the sum of the "Amount" column where the corresponding "Account" forum equals "Paypal".
This is as far as I can get!
=SUM(Q:Q)*(O:O="Paypal")
I believe rather than using SUM()
you want the SUMIF()
function. I don't have Excel to hand but I believe you need your formula to be
=SUMIF(O:O,"Paypal",Q:Q)
From this site
The syntax for the SumIf function is:
SumIf( range, criteria, sumRange )
range is the range of cells that you want to apply the criteria against. (your column containing "Paypal"
criteria is used to determine which cells to add. - In your case matching "paypal"
sumRange are the cells to sum.
Also see this Microsoft help page, and this page which has some more advanced functions such as DSUM and SUMPRODUCT.