How to create a numeric code

raul8

New Member
Joined
Sep 21, 2021
Messages
36
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
  2. Web
Hello everyone, I'm at a lost here...

Please help with this task:
Create a numeric code in your spreadsheet where yes = 0 and no = 1.

Appreciate all the posts I can get. Thank you!

AlvarezD_Datamanagement.xlsx
ABCDEFGHI
3STK-1STK-2STK-3STK-4STK-5STK-6STK-8STK-10
41YYYNNYNY
52YYYYYYYY
63YYYYYYYY
74YYYYYYYY
85NYNAYNYYY
96NYYYYYYY
107YYYYNYYY
118YNYYYNNY
129NYNAYNYNN
1310YYNANYYNY
1411NYNANYNNN
1512YYNAYYYYY
1613YYNYYYNN
1714YNYYYNYY
1815YYYYYYYY
1916NYYYYYYY
2017YYYYNNNY
2118NYNAYYYNY
2219NYYYNYYY
2320YNYYYYYY
2421YYYYYYNY
2522YYYYYYYY
2623YYNYYNNY
2724YYNYYYYY
2825NYNAYYNNY
2926YYNANNYYY
3027NNYYNNNN
3128NYYNYYYN
3229NYNNYYYY
3330YYYYYYYN
3431YYYYNYYY
3532YNNAYYYNN
3633YYNAYNYNY
3734YNYYYNYN
3835NYNYNYNY
Data
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B4:I38Cell Valueunique valuestextNO
I4:I38Cell Value="Y"textNO
E4:E38Cell Value="Y"textNO
H4:H38Cell Value="Y"textNO
G4:G38Cell Value="Y"textNO
F4:F38Cell Value="Y"textNO
D4:D38Cell Value="Y"textNO
C4:C38Cell Value="Y"textNO
C4:C38Cell Value="Y=0"textNO
B4:B38Cell Valuecontains "Y"textNO
B4:B38Cell Value="Y=0, N=1"textNO
B4:B38Cell Valuecontains "Y=1"textNO
 

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
Hi,

To create a custom number format that would display “Y” for 0 and “N” for 1, first, select all the cells in the column where you want this to be displayed.

Press Ctrl+1 to display the Format Cells dialog

In the Number tab, choose the Custom category.

Then enter this custom number format in the Type edit box:

"N";;"Y";

Press OK button



Hopefully, this will do what you want



Dave
 
Upvote 0
Hi,

To create a custom number format that would display “Y” for 0 and “N” for 1, first, select all the cells in the column where you want this to be displayed.

Press Ctrl+1 to display the Format Cells dialog

In the Number tab, choose the Custom category.

Then enter this custom number format in the Type edit box:

"N";;"Y";

Press OK button



Hopefully, this will do what you want



Dave
Hi Dave,

I'm sorry but this did not work.
 
Upvote 0
It is not clear exactly where you want this 'code' or how it should be formatted.
Should the existing Y and N be replaced with 1 and 0? If so then you need to use 'replace' as suggested in post 2.
Should the 'code' be produced in another row / column? If so where and how should it be shown? As a sum of Y=1 +N=0? In which case, I have already provided the answer in your previous thread where you asked for something similar as a secondary question.
Should it be something else? If yes then what?
 
Upvote 0
Works ok for me - check that you have entered the format code exactly as published.

Dave
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

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