Extended IF Formula

B

Barny

I use this formula to return the value in cell if the criteria is met
but I would like to extend this to say that the value is also returned
if cell J89 = ("C") i.e. either or I89 = W or J89 = C.

=IF(AND(A89>0,I89="w"),A89,"0")

Hope that makes sense
 
T

T. Valko

If I understand, try this...

=IF(AND(A89>0,OR(I89="W",J89="C")),A89,0)

It can also be written as:

=AND(A89>0,OR(I89="W",J89="C"))*A89
 
J

Joe User

Barny said:
I would like to extend this to say that the value
is also returned if cell J89 = ("C") i.e. either
or I89 = W or J89 = C.
=IF(AND(A89>0,I89="w"),A89,"0")

=IF(AND(A89>0,OR(I89="w",J89="c")), A89, 0)

Note that I wrote zero, not "0". That assumes that A89 is numeric, and you
want to return the number zero, not the text string "0".

PS: My formula above can be shortened to:

=A9*(A89>0)*(I89="w",J89="c")

If A9 cannot be less than zero, that can be simplified further to:

=A9*OR(I89="w",J89="c")


----- original message -----
 
B

Barny

T. Valko;939697 said:
If I understand, try this...

=IF(AND(A89>0,OR(I89="W",J89="C")),A89,0)

It can also be written as:

=AND(A89>0,OR(I89="W",J89="C"))*A89

These formulas are fine and do the job, but what I would also now lik
to say is:

If I89= W return W in A89 or if J89 =C return C in A89
This is based on I89 / J89 either being blank or containing W or C
There will not be a scenario where I89 and J89 contain w and c at th
same tim
 

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