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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
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,214,621
Messages
6,120,568
Members
448,972
Latest member
Shantanu2024

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