简体   繁体   中英

Excel Formula | Count all values that have the “keyword” in the adjacent cell in the row

This will be my first question on stackoverflow, I have done as much researching via google and this site but nothing I found relatable to this particular example. I attempted SUMIFS, VLOOKUP, etc.

This excel sheet will serve as donation tracker, each person will have their own row that goes from Jan-Dec. 1st sheet will serve as a tracker for the year, and the second sheet is where I want to the formula to tell me how much that person contributed via the 4 payment methods: Check, Cash, PayPal, and Facebook.

I'm having a hard time getting excel the formula to count the value for each type of payment in the row.

Here are snippets of my 2 sheets: 在此处输入图片说明在此处输入图片说明

I would suggest a different format. There is no easy formula that will work with your current format. Sumif won't work with your format because the donation criteria is in the same row/column as the donation amount.

Example Format

Sheet 1 would be as follows: Column A-Month, Column B-Name, Column C-Donation Type, and Column D-Donation Amount. Column B is redundant, but is necessary with Sumifs. Sumifs allows you to have multiple criteria, but both criteria have to be the same size adjacent to the row/column you are summing. Column B can be hidden for a cleaner looking spreadsheet. Columns FH represent sheet 2.

The formula in G2 is as follows: =sumifs(D:D,B:B,F2,C:C,G1)

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