IF formula problem

ishabir

Board Regular
Joined
Nov 7, 2003
Messages
77
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.

Thanks in advance.

ishabir
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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?
 
Upvote 0
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")
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,215,579
Messages
6,125,646
Members
449,245
Latest member
PatrickL

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