# If and or formula

#### Jensen 3:16

##### Board Regular
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

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

Last edited:

### Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

#### Jensen 3:16

##### Board Regular
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

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

Last edited:

##### MrExcel MVP
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

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")

#### T. Valko

##### Well-known Member
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

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>

H

Last edited:

#### daffy

##### Board Regular
Sorry formula wont post

Last edited:

#### T. Valko

##### Well-known Member
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>

#### daffy

##### Board Regular
ive just been googling it

Don

#### Jensen 3:16

##### Board Regular
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

#### T. Valko

##### Well-known Member
Your formula worked perfect and thank you for the character tip
You're welcome. Thanks for the feedback!

Replies
7
Views
121
Replies
1
Views
142
Replies
3
Views
45
Replies
2
Views
87
Replies
8
Views
78

1,191,707
Messages
5,988,223
Members
440,139
Latest member
ngaicuong2017

### 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.

### Which adblocker are you using?

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

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