If and or formula

Jensen 3:16

Board Regular
Joined
Jul 4, 2004
Messages
50
In cell Q3 I have the formula =IF(AND(C3="UP",M3<M2),"Same","Different")

What I would like to do is incorporate another formula in the same cell Q3 that states =IF(AND(C3="Down",M3>M2),"Same","Different"), but I am getting stuck on how to do that.

Basically if C3 reads "UP" and M3 < M2 I want the return to state the word "Same"
or
C3 reads "Down" and M3>M2 I want the return to state the word "Same"

Any other combination such as C3="UP", M3>M2 I want the return to read "Different".

Any help on how to do this would be greatly appreciated. Thank you in advance.
 
Last edited:

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Sorry, this is the full question

What I would like to do is incorporate a formula in cell Q3 that states

if C3 reads "UP" and M3 < M2 I want the return to state the word "Same"
or
C3 reads "Down" and M3>M2 I want the return to state the word "Same"

Any other combination such as C3="UP", M3>M2 I want the return to read "Different".

Any help on how to do this would be greatly appreciated. Thank you in advance.
 
Last edited:
Upvote 0
Sorry, this is the full question

What I would like to do is incorporate a formula in cell Q3 that states

if C3 reads "UP" and M3 < M2 I want the return to state the word "Same"
or
C3 reads "Down" and M3>M2 I want the return to state the word "Same"

Any other combination such as C3="UP", M3>M2 I want the return to read "Different".

Any help on how to do this would be greatly appreciated. Thank you in advance.

Looks like you want...

=IF(AND(OR(C3 = "UP", C3 = "Down"), OR(M3 > M2, M3 < M2)), "Same", "Different")
 
Upvote 0
Sorry, this is the full question

What I would like to do is incorporate a formula in cell Q3 that states

if C3 reads "UP" and M3 < M2 I want the return to state the word "Same"
or
C3 reads "Down" and M3>M2 I want the return to state the word "Same"

Any other combination such as C3="UP", M3>M2 I want the return to read "Different".

Any help on how to do this would be greatly appreciated. Thank you in advance.
Try this...

=IF(OR(AND(C3="up",M3 < M2),AND(C3="down",M3 > M2)),"Same","Different")<M2),AND(C3="DOWN",M3>
 
Upvote 0
Sorry formula wont post
The forum software evaluates the "less than" and "greater than" symbols as special characters.

To avoid problems related to that, when you post formulas that use those symbols put space characters on either side of the symbol like I did in my reply.

=IF(OR(AND(C3="up",M3 < M2),AND(C3="down",M3 > M2)),"Same","Different")

Here's how that formula gets posted without using the space characters:

=IF(OR(AND(C3="up",M3<M2),AND(C3="DOWN",M3>M2)),"Same","Different")

All of this got stripped out:

< M2),AND(C3="down",M3 >

It takes a while to get used to and even then, you may not always remember to do it!
<M2),AND(C3="DOWN",M3><M2),AND(C3="DOWN",M3><M2),AND(C3="DOWN",M3>
 
Upvote 0
The forum software evaluates the "less than" and "greater than" symbols as special characters.

To avoid problems related to that, when you post formulas that use those symbols put space characters on either side of the symbol like I did in my reply.



Here's how that formula gets posted without using the space characters:

=IF(OR(AND(C3="up",M3<M2),AND(C3="DOWN",M3>M2)),"Same","Different")

All of this got stripped out:

< M2),AND(C3="down",M3 >


It takes a while to get used to and even then, you may not always remember to do it!
<M2),AND(C3="DOWN",M3><M2),AND(C3="DOWN",M3><M2),AND(C3="DOWN",M3>

Your formula worked perfect and thank you for the character tip :)
 
Upvote 0

Forum statistics

Threads
1,224,519
Messages
6,179,263
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top