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 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
Joined
May 19, 2002
Messages
2,916
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?
 

ishabir

Board Regular
Joined
Nov 7, 2003
Messages
77
I am getting FALSE.

thanks

ishabir
 

Yesuslave

Active Member
Joined
Sep 19, 2003
Messages
297
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
Joined
Nov 7, 2003
Messages
77
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
 

Forum statistics

Threads
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.
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
Top