I am trying to code an IF
statement to sum based on certain criteria.
I have attached a screen shot for better understanding. Essentially what I want to achieve is this:
Screen shot below, and as always thank you so much for any help you can give
=IF(O4="yes",SUM(R4:T4),"fail")
如果您要检查任何潜在的错误或空白,这将fail
除"yes"
以外的每个值都fail
。请使用
=IF(O4="yes",SUM(R4:T4),IF(O4="no","fail","ERROR"))
You could do this with the following formula:
=IF(O4="yes",SUM(R4:T4),"fail")
But that would mean that fail
would return for all values that are not yes
, not just no
.
So alternatively, you could use this formula:
=IF(O4="yes",SUM(R4:T4),IF(O4="no","fail","foo"))
But you need to think about what happens if O4 is neither yes
nor no
.
HTH.
Hi so I hope this helps someone as this site is amazing for helping Rookies like me out. I wanted a txt response to certain criteria and the formula that works in my example is =IF(O4="No","FAIL",SUM(R4:T4))
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.