I have big issue in excel formula

Copper Contributor

Good evening,

 

I have big issue with excel. I want to calculate number of days "long stay patient" from admission date based on 3 criteria.

 

1. if discharge patient not today, then calculate number of days " long stay patient" from admission till discharged date.

 

2. if expired patient not today, then calculate number of days " long stay patient" from admission till expired date.

 

3. if not discharge or expired, then calculate number of days " long stay patient" from admission till today.

 

Please see excel sheet in attachment

 

Thanks a lot

2 Replies

@alrasi 

Try this:

=MAX(0,IFERROR(1/(1/(L4+M4)),TODAY())-E4)

@alrasi   try this...  (in cell G6)

 

=IF(AND(ISBLANK($L6),ISBLANK($M6)),"",IF(ISBLANK($M6),DAYS($L6,$E6),DAYS($M6,$E6)))