Forum Discussion
Help with turning categorical variable to numerical
Hello, I have a statistical coding assignment and one of my tasks is to turn a bunch of different numerical variables into categorical. I have to use a logical function and it works perfectly when I use eg. =IFS(A1=1, "Curly", B1=1, "Curly" ect...). However I have a few rows in my data set where there is no data for these cells and I need to have it in my formula where 'if A1:I1="", "" so that way I don't have #N/A. I know I could use find and replace and stuff but I have to have it in my formula to keep the cells blank when there's no data to output- if that makes sense. Any help would be appreciated!!
2 Replies
- Olufemi7Steel Contributor
HelloCtross​,
Use an IF wrapper to return blank when the entire row has no data and simplify the logic with OR
=IF(COUNTA(A1:I1)=0,"",IF(OR(A1=1,B1=1,C1=1),"Curly",""))
This keeps the cell blank when A1:I1 is empty and avoids #N/A while returning Curly when any condition is met
- HecatonchireIron Contributor
Hello
=IFS(A1=1, "Curly", B1=1, "Curly",... ,TRUE,"")