Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Efficient way for converting Yes/No to 1/0 in Excel or SPSS

I am trying to find an efficient way for converting yes/no to 1/0 in Excel. Since I am doing the data analyzing at SPSS. Or if there is a way converting YES/NO to 1/0 in SPSS directly?

like image 531
JavaLeave Avatar asked Oct 22 '25 04:10

JavaLeave


2 Answers

Try this syntax in SPSS:

This will create a new field with 1 and 0. Also keep in mind that it's case sensitive.

numeric boolFieldName(f1).

recode ynFieldName ("YES" = 1) ("NO" = 0) into boolFieldName.
execute.
like image 182
dosdel Avatar answered Oct 23 '25 19:10

dosdel


If a cell contains yes or no (say cell A1) then in another cell enter:

=IF(A1="yes",1,0)

like image 36
Gary's Student Avatar answered Oct 23 '25 21:10

Gary's Student



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!