Add condition to formula

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

I want to add a condition to a formula so that the formula only returns a
result if the condition is met. Here is the formula:

=SUMIF(PO!$AI$24:$AI$1499,PO!$AI195,PO!$AN$24:$AN$1499)

If an additional cell PO!$AR195 contains the value "Yes" the formula will
return a result. If there is no value in PO!$AR195 then no result will be
returned.

Anyone know how to incorporate the above condition into the formula?

Many thanks if you can help.
Pat
 
try this on any empty cell and see whether it gives waht you want

=IF(PO!$AR195="yes",SUMIF(PO!$AI$24:$AI$1499,PO!$AI195,PO!$AN$24:$AN$1499))

========================
 
To make the cell appear empty if the condition isn't met, you need to specify
the result to be returned in that case -- otherwise you get FALSE, i.e.

=IF(PO!$AR195="yes",SUMIF(PO!$AI$24:$AI$1499,PO!$AI195,PO!$AN$24:$AN$1499),"")
 
=SUMIF(PO!$AI$24:$AI$1499,PO!$AI195,PO!$AN$24:$AN$1499)*(PO!$AR195 ='yes")
Gives zero when second condition not met

best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top