简体   繁体   中英

Google sheets: cumulative addition of cells in a row, based upon a boolean condition in another cell

I'm trying to establish add up a series of cell values in a single row of a google sheet. The sheet records invoices against an associated purchase order. Usually, there are multiple invoices in a schedule for each PO. I want to be able to create a method for looping through a row, and adding up the invoice amount IF the drop down value of yes has been selected.

https://docs.google.com/spreadsheets/d/1hrJlcfT7y_gKWb0E1qUrn7wiJq1bdNl5kCZhum-TV3w/edit?usp=sharing

Currently the formula in A3 is looping though: and totaling every invoice value (ie in D3, H3, L3, P3 etc):

=SUMPRODUCT(--(MOD(COLUMN(B3:Y3),4)=0),B3:Y3)

However, I can't figure out how to do this with the conditional value in another cell (E3, I3, M3, Q3.... etc). Any ideas if this is possible, and if so, any idea how?

偏移下一个范围并检查是否yes

=SUMPRODUCT(--(MOD(COLUMN(B3:Y3),4)=0),B3:Y3,--(C3:Z3 = "yes"))

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