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...
jaolvera
Brass Contributor
the yes is created by have a number in m2 and a date in q2
jaolvera
Aug 18, 2023Brass Contributor
and the no would be if there is a number in M2 and No date in q2 mathetes
- mathetesAug 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.