Forum Discussion

jaolvera's avatar
jaolvera
Brass Contributor
Jun 07, 2023

IF formula

Hello, I needed a formula that would reference one of 2 dates. so if column Q contains "Yes" then reference the date in column R, or if Column Q contains "No" then reference date in cell O. Thank you!

 

  • jaolvera 

    Using named ranges

    = IF(symptomatic="Yes", onsetDate, episodeDate)
    
    or, borrowing from Patrick,
    = SWITCH(symptomatic, 
          "Yes", onsetDate, 
          "No",  episodeDate, 
      "")

     

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    jaolvera 

    Perhaps this one (You can change out the "-" with any desired text to show if the cell is neither "yes" or "no":

     

    =SWITCH(Q2,"yes",R2,"no",O2,"-")

Resources