excelconvertersspss

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?


Solution

  • 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.