Forum Discussion

jaolvera's avatar
jaolvera
Brass Contributor
Sep 06, 2023

Formula for excel

Hello! I needed assistance with a formula that will be a "yes or no" in column A, that will determine if the dtcreate (column o)  within each group of patient IDs is within 28 days of each other. 

 

  • jaolvera 

    =IF(LARGE(IF($C$2:$C$13=C2,$O$2:$O$13-$P$2:$P$13),1)<=28,"Yes","No")

    You can try this formula. Enter the formula with ctrl+shift+enter if you don't work with Office 365 or Excel 2021.

     

    • jaolvera's avatar
      jaolvera
      Brass Contributor
      hello! thank you, for the dates its only the dates in column o, so within each patient ID, there are multiple "date created" and within those I need to determine if any of them are within 28 days.
      • OliverScheurich's avatar
        OliverScheurich
        Gold Contributor

        jaolvera 

        =BYROW(C2:C14,LAMBDA(x,IF(SMALL(IFNA(DROP(SORT(FILTER(O2:O14,C2:C14=x)),1)-SORT(FILTER(O2:O14,C2:C14=x)),0),2)<=28,"Yes","No")))

         

        Does this return the intended result? I've added sample data where 2 dates in column O are within 28 days for a group of IDs.

Resources