# 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 create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

#### 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
4
Views
99
Replies
5
Views
115
Replies
2
Views
208
Replies
1
Views
89
Replies
8
Views
94

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,152,161
Messages
5,768,547
Members
425,481
Latest member
ihumanl

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

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