Forum Discussion
raybearz
3 years agoFrequent Visitor
Only Sum Latest Value and Exclude Duplicates
Hi all In the following table, how do I exclude the first two "accounts payable" sections and just return the sum of the highlighted numbers? Basically I want to exclude earlier periods ...
jdurmus
3 years agoNew Member
To exclude the first two "Accounts Payable" sections and only sum the highlighted numbers, you can use the SUMIFS function in Excel.
Assuming your table starts from cell A1, you can use the following formula to get the desired result:
=SUMIFS(D2:D9, C2:C9, "Accounts Payable", B2:B9, "202212") + SUMIFS(D2:D9, C2:C9, "Retainage Payable", B2:B9, "202210")
In this formula, the SUMIFS function is used to sum the amounts for the conditions that only "Accounts Payable" amounts for the period "202212" and "Retainage Payable" amounts for the period "202210" should be included.
Note that the highlighted rows in your example have negative amounts, so the total sum will be negative as well.