简体   繁体   中英

Sum all cells for which corresponding cell is not a formula

Following this 2019 question and it's great answer I have learnt that to sum all cells that has formula, I should use:

=SUMPRODUCT((ISFORMULA(B5:M5)=TRUE)*B5:M5)

And to sum the cells that doesn't have formula, I should consider:

=SUMPRODUCT((ISFORMULA(B5:M5)=FALSE)*B5:M5)

But, can I use the above (or something else) in the way similar to using SUMIF with three arguments (summing values from other column than the one that is checked for conditions)?

Meaning that I need to solve following problem:

Sum all values in the range I2:I21 , but only for those cells for which the corresponding cells in the range B2:B21 are not a formula / enumerable value.

I wonder if I'm not excepting too much and whether such a problem can be solved with just a formula, without using a macro.

The other answer posted under mentioned question has gave me an insight to solve this problem.

Using following formula:

=SUMPRODUCT((I2:I21)*(NOT(ISFORMULA(B2:B21))))

gives me exactly the values that I want. That is: sum of all values in I2:I21 range for which corresponding cell in B2:B21 range is a "hardcoded" value and not a result of an evaluable formula.

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