Returning a value when 2 other values are true

L

Lman

I know how to use an IF statement to return a value from a cell B if cell A
is true (for example =IF(A1=100,B3,"no value found"). However i need to
compare 2 values and return a 3rd if both values are true. For example, If
cell A is >100 and cell B is <200 then return cell c.
 
B

Bernard Liengme

=IF(AND(A1>100,B1<200),C1,"Two conditions not met")
but more realistically
=IF(AND(A1>100,B1<200),C1,"")
which give either C1 or makes the cell appear blank

If you are happy with getting zero when the two conditions are not meet, you
can avoid IF
=(A1>100)*(B1<200)*C1

best wishes
 
B

Bernd P

Hello,

The boring solution:
=If(And(A1>100,B1<200),C1)

The funny solution:
[text result] =REPT(C1,(A1>100)*(B1<200))
[value result] =--REPT(C1,(A1>100)*(B1<200))

Regards,
Bernd
 
L

Lman

Thanks!! that was exactly what i was looking for, in fact posting a zero when
the conditions are not met is even better.
 

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

Top