If you really want to stick to a regular IF
function, you can simply combine the various conditions. In particular, instead of value_if_false
, insert the next IF
statement. Both approaches assume that your data is in the range A1:C5
, and you paste the formula into cell D2
and copy it down. The values are divided by ";", but you can simply delete this if you do not need it.
IF Function:
=IF(AND(A2:C2)=TRUE,"Male; 18+; College Degree",
IF(AND(A2,B2)=TRUE,"Male; 18+",
IF(AND(A2,C2)=TRUE,"Male; College Degree",
IF(AND(B2,C2)=TRUE,"18+; College Degree",
IF(A2=TRUE,"Male",IF(B2=TRUE,"18+",IF(C2=TRUE,"College Degree","ERROR")))))))
Since this procedure is quite tedious, especially if you have multiple conditions, another approach would be to simply use the FILTER
function for the cases that are TRUE and then join them accordingly.
=TEXTJOIN("; ",TRUE,FILTER($A$1:$C$1,A2:C2=TRUE))
IF
Statements each separated by&" "&
(concatenation of a blank space between each IF).