IF and RIGHT Formula?

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,748
Office Version
  1. 365
Platform
  1. Windows
I think I need an IF & RIGHT formula please. I have like below where I need the formula to say if the last 2 letters are LH or RH then the number 1, if there is nothing then the number 2. Thanks

Suspension Arm-LH
Suspension Arm-RH
Ball Joint

<colgroup><col></colgroup><tbody>
</tbody>
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Should there be an 'else' formula in there also?
 
Upvote 0
Then it should be working with the formula as it is, I get the correct output of 2 when I copy and paste your data from C3 in to my test sheet.

So for "FAI Ball Joint" I get 2 as expected.

How is the data getting in to cell A3? is it typed, copied and pasted, or a formula pulling from somewhere else? Not that it should matter though.
 
Upvote 0
Select B3 and on the formulas tab select Evaluate formula. Click Evaluate and post which of the two conditions return true.
 
Upvote 0
Ok, then it should be giving you the proper output.

The IF statement gives an answer for either a "true" or "false" value, so for "True" it will give you a 1, for "false" it will give you a 2.

Your true/false test is the "OR" function in that formula and it is checking cell A3's right 2 values and testing if it is either "LH" or "RH", if it is one of those it will return "true" otherwise it gives you "false".

As I said it is working for me.

Can you press F9 on your keyboard and see if it works or not.
 
Upvote 0
Select B3 and on the formulas tab select Evaluate formula. Click Evaluate and post which of the two conditions return true.
I don't see anything returning true.
 
Upvote 0
It seems to be ok now, don't know what was wrong. Thanks both for your trouble.
 
Upvote 0

Forum statistics

Threads
1,215,836
Messages
6,127,183
Members
449,368
Latest member
JayHo

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