# how to write nested if condition

#### genetist

##### Board Regular
Hi to all,
I need help in solving my problem, My data look like this
 Parents sx1 sx2 sx3 sx4 sx5 sx1 sx2 sx3 sx4 sx5 P1 AA ZZ // AA GG P2 GG GG AA AA GG my IF result Parents sx1 sx2 sx3 sx4 sx5 sx1 sx2 sx3 sx4 sx5 P1 AA ZZ // AA GG P2 GG GG AA AA GG poly poly poly mono mono Expected Parents sx1 sx2 sx3 sx4 sx5 sx1 sx2 sx3 sx4 sx5 P1 AA ZZ // AA GG P2 GG GG AA AA GG poly mono mono mono mono

<colgroup><col span="11"></colgroup><tbody>
</tbody>

<tbody>
</tbody>
my if condition is like this =if(A2=A1,"mono","poly") but i want mono in the cells where there are ZZ and // this characters also. How can i write if condition formula to get my expected result?
help need in this issue
Regards,
Genetist

### Excel Facts

Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Not a nested if, but it does what you want (If P1 or P2 is ZZ or //; or if P1=P2).

=IF(OR(A1="ZZ";A1="//";A2="ZZ";A2="//";A1=A2)=TRUE;"mono";"poly")

try below

=IF(A1=A2,"mono",IF(OR(A1="ZZ",A1="//"),"mono",IF(OR(A2="ZZ",A2="//"),"mono","poly")))

Hi
ARAVIND and Jefrey20 thank you very much for your help and spending your valuable time to help me. your formula is working and i adjusted according to my requirement.
Thanks lot
Regards,
genetist

Replies
0
Views
151
Replies
3
Views
357
Replies
1
Views
308
Replies
9
Views
400
Replies
5
Views
1K

1,196,346
Messages
6,014,731
Members
441,843
Latest member
benji 71

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