# IF formula problem

#### ishabir

##### Board Regular
Having problem with a formula. What I am trying to say is...
if J2 equals 3042B OR 3042BP OR 304L2BP then in K2 I want 304/304L.

here is my formula
=IF(OR(J2="3042B",J2="3042BP",J2="304L2BP"),"304/304L")

Can anyone help.

ishabir

### Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

#### Seti

##### Well-known Member
What is the problem you have this formula? Is the formula put in cell K2? You don't have a false condition either. What would you like to have in K2 if one of the 3 conditions on J2 is not met?

#### Yesuslave

##### Active Member
I put that formula in and it worked fine. What are you getting?

#### texasalynn

##### Well-known Member
It works for me. What kind of problem are you having?

texasalynn

#### ishabir

##### Board Regular
I am getting FALSE.

thanks

ishabir

#### Yesuslave

##### Active Member
You'll get false if J2 doesn't equal any of your conditions. If you want to get something particular when the conditions are false, add another condition to the end, like this:
=IF(OR(J2="3042B",J2="3042BP",J2="304L2BP"),"304/304L", "Not a false statement")

#### ishabir

##### Board Regular
Ok, i have just realised what the problem is. J2 has trailing spaces which means the formula does not work.

I will sort that now.

Thanks.

ishabir

Replies
2
Views
138
Replies
5
Views
166
Replies
0
Views
77
Replies
9
Views
143
Replies
3
Views
139

1,186,163
Messages
5,956,297
Members
438,246
Latest member
Deelea

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