简体   繁体   中英

Excel sum all values that match three criteria

I'm trying to sum values in one column that match a month found in another column and a substring found in another column.

Sample Data:

DATE        DESCRIPTION                 ACCOUNT       AMOUNT
1/1/2018    Deposit - Account 1023345   Income    $ 1,000.00 
1/2/2018    Payment - Vendor 00359      Expenses  $  (435.12)
1/3/2018    Payment - Employee 0135     Salary    $(1,293.16)

Sample formula to get all payments made to vendor 00359 in January:

=SUMIFS(Daily!D2:Daily!D16384,
        Daily!A2:Daily!A16384,
        MONTH(Daily!A2:Daily!A16384)=1,
        Daily!C2:Daily!C16384,
        "Salary",
        Daily!B2:Daily!B16384,
        SEARCH("Vendor 00359", Daily!B2:Daily!B16384)
       )

This returns a value of "0" but it should be -435.12

EDIT: As Scott Craner mentioned, I need to create a new column for Month, which is easy enough, but I need to search for more than one item. How can I avoid creating a new column for each search criteria I need? I can foresee dozens of such searches that will need to take place.

使用SUMPRODUCT:

=SUMPRODUCT(Daily!D2:D16384,(1 = MONTH(Daily!A2:A16384))*(Daily!C2:C16384="Salary")*(ISNUMBER(SEARCH("Vendor 00359",Daily!B2:B16384))))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM