using IF function with AND/OR

I

Ian R

Hi

I have successfully used the IF function on my worksheet so that if two
conditions are met it will do one calculation or another

However I'd like to know if its possible to get it to work with three
conditions e.g

if a1="y" AND b1="y" then f1*5% otherwise f1*10% but if a1<>"y" then just
ignore the calculation and enter a zero or a blank space.

I've got as far as nesting the first logical part which works e.g.

=IF(AND(A1="y",B1="y"),F1*5%,F1*10%)

But it falls over if A1 is anything other than "y".

How can I get it to do the first if/then but ignore them both if A1 does not
= "y"?

I hope this is clear and there isn't too much repetition.

Thanks very much for your time and assistance

Ian
 
I

Ian R

Ian R said:
Hi

I have successfully used the IF function on my worksheet so that if two
conditions are met it will do one calculation or another

However I'd like to know if its possible to get it to work with three
conditions e.g

if a1="y" AND b1="y" then f1*5% otherwise f1*10% but if a1<>"y" then just
ignore the calculation and enter a zero or a blank space.

I've got as far as nesting the first logical part which works e.g.

=IF(AND(A1="y",B1="y"),F1*5%,F1*10%)

But it falls over if A1 is anything other than "y".

How can I get it to do the first if/then but ignore them both if A1 does
not = "y"?

I hope this is clear and there isn't too much repetition.

Thanks very much for your time and assistance

Ian


Dave & Mama

Thanks guys - worked a treat!

I've been pulling my hair out on this one for ages.

I humbly bow in my appreciation to you Guru's!

Ian I^)
 
D

David Biddulph

=IF(A1<>"y",0,IF(B1="y",F1*5%,F1*10%))
[You don't need the AND(A1="y",B1="y"), because you don't get to the second
test unless A1="y".]
 

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