简体   繁体   中英

SUMIF a cell on the same row, in a certain column, contains a specific text

I'm trying to sum all transactions on a spreadsheet of my bank statement. Let's say I have the following under columns BF:

         B        C             D            E          F         G
        Date    Type       Transaction      Value     Balance    ???
row 4 23/05/14  BAC      Bank transfer A   1103.55    637.03
row 5 23/05/14  POS      Pizza purchase    10.00      627.03
row 6 23/05/14  POS      Coffee purchase   10.00      627.03

I'd like to make a new cell on column G which sums all values in column E that are on rows containing "POS" in column C. Is this possible?

Yes and I believe the simplest way is by using SUMIF :

=SUMIF(C:C, "POS", E:E)

In other words, sum E:E if C:C equals "POS".

=SUM(IF(C4:C6="POS",1,0)*E4:E6) is one way. Expand the ranges to taste.

Note this is an array formula : you need to press Ctrl + Shift + Return once you're done editing.

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