Converting Formula Yes No 0 1

Mstg007

Active Member
Joined
Dec 30, 2013
Messages
383
.
I am trying to combine the first formula with the one below. The It will read from the index a yes or no, and I want the yes or no to be converted to 0 and or 1.
Thanks for any help!
Code:
=(INDEX('Sheet2'!$AS$20:$AS$100,MATCH($BK20,'Sheet2'!$A$20:$A$100,0)))

Code:
=if(A1=0,"NO",if(a1=1,"YES",""))
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try

=--(INDEX('Sheet2'!$AS$20:$AS$100,MATCH($BK20,'Sheet2'!$A$20:$A$100,0))="No")

If the INDEX = Yes, it will return 0
If the INDEX = No, it will return 1
 
Upvote 0
You're welcome.

Try
=(INDEX('Sheet2'!$AS$20:$AS$100,MATCH($BK20,'Sheet2'!$A$20:$A$100,0))="No")+4
 
Upvote 0
Thank you so much again! Don't worry about the R thing... I can work around that. Is there also a way to reverse it? So Numbers to Letters?
 
Upvote 0
Why don't you explain what you really want, in it's Entirety.
Instead of adding on little bits and pieces as we go.
 
Upvote 0
I will do my best to explain. I am trying to convert letters (Yes, No, R) to Numbers (R=3, Yes=4, No=5) and then vice versa in another formula. (So two formulas). The reason is that I am saving this out to an external file. The other program I am opening it with can only use Numbers not letters. So As I change the values in the other program to the numbers, I can import them back into my spreadsheet as Yes NO R etc.

I hope that makes sense. Thank you again
 
Upvote 0
I will do my best to explain. I am trying to convert letters (Yes, No, R) to Numbers (R=3, Yes=4, No=5) and then vice versa in another formula. (So two formulas). The reason is that I am saving this out to an external file. The other program I am opening it with can only use Numbers not letters. So As I change the values in the other program to the numbers, I can import them back into my spreadsheet as Yes NO R etc.
Why not leave everything in numbers and just Custom Format your cells using this...

[=3]"R";[=4]"Yes";"No"
 
Upvote 0
OK, Sorry to sound so blunt before.
Reason being that many times the solution to your 'simplified' version is not applicable to your 'real' situation.
Which is the case here.
With just the Yes or No, it's a very simple binary 1/0 True/False function.
It get's more complicated with more than 2 possible scenarios.

Anyway, off the soapbox.


Try these
replace index with your original formula.

For Words/Letter to Number
=MATCH(index,{"R","Yes","No"},0)+2

To reverse it
=CHOOSE(A1-2,"R","Yes","No")
A1 is the cell holding the 3 4 or 5
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,914
Members
449,054
Latest member
luca142

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