简体   繁体   中英

Summing based on multiple conditions in matching rows Excel

I'm needing to sum column H if:

Any value in D matches B of the same row, and if any value in D matches a specific cell in L. For example,

IF D:D = B:B on the same row, AND F:F on the same row != Y, AND D:D = L2, then SUM = 2.0

IF D:D = B:B on the same row, AND F:F on the same row != Y, AND D:D = L3, then SUM = 1.2

在此处输入图片说明

There will be a couple hundred rows that will follow this. I hope this makes sense.

Try this one:

=SUMPRODUCT((B:B=D:D)*(F:F<>"Y")*(D:D=L2)*(H:H))

To make formula faster I suggest you to use exact ranges:

=SUMPRODUCT((B2:B100=D2:D100)*(F2:F100<>"Y")*(D2:D100=L2)*(H2:H100))

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