Forum Discussion
jaolvera
Aug 18, 2023Brass Contributor
If and statement
Hello! I needed assistance with creating a formula cell o2, essentially, I need "yes or no" to auto populate IF there is a date in symptom onset (q2) AND M2 is not blank, otherwise I just want the ce...
mathetes
Aug 18, 2023Silver Contributor
See attached.
This is the formula in cell O2
=IFS(
AND(ISNUMBER(M2),ISNUMBER(Q2)),"Yes",
AND(ISNUMBER(M2),ISBLANK(Q2)),"No",
AND(ISBLANK(M2),ISBLANK(Q2)),""
)
Note that this is an IFS function, which handles multiple conditions very easily. This means you could add more combinations, more consequences, just be spelling them out.
I also use Data Validation to make sure there are numbers, or a date, in columns M and Q respectively.