Please try at B2 for Max Borrow Books
and press Ctrl+Shift+Enter
Formula:
=MAX(MMULT(TRANSPOSE(ROW(Before!$B$2:$B$77)^0),(Before!$B$2:$B$77<=TRANSPOSE(ROW(INDIRECT(--"1/1/17"&":"&--"1/1/20"))))*(TRANSPOSE(ROW(INDIRECT(--"1/1/17"&":"&--"1/1/20")))<=Before!$C$2:$C$77*(Before!$A$2:$A$77=A2))))
C2 for 1st date of Max borrow
and press Ctrl+Shift+Enter
Formula:
=MATCH(B2,MMULT(TRANSPOSE(ROW(Before!$B$2:$B$77)^0),(Before!$B$2:$B$77<=TRANSPOSE(ROW(INDIRECT(--"1/1/17"&":"&--"1/1/20"))))*(TRANSPOSE(ROW(INDIRECT(--"1/1/17"&":"&--"1/1/20")))<=Before!$C$2:$C$77*(Before!$A$2:$A$77=A2))),)+"1/1/17"-1
D2 for last date of Max borrow
and press Ctrl+Shift+Enter
Formula:
=MATCH(2,1/(MMULT(TRANSPOSE(ROW(Before!$B$2:$B$77)^0),(Before!$B$2:$B$77<=TRANSPOSE(ROW(INDIRECT(--"1/1/17"&":"&--"1/1/20"))))*(TRANSPOSE(ROW(INDIRECT(--"1/1/17"&":"&--"1/1/20")))<=Before!$C$2:$C$77*(Before!$A$2:$A$77=A2)))=B2))+"1/1/17"-1
Add for not include return date in F2
press Ctrl+Shift+Enter
Formula:
=MAX(MMULT(TRANSPOSE(ROW(Before!$B$2:$B$77)^0),(Before!$B$2:$B$77<=TRANSPOSE(ROW(INDIRECT(--"1/1/17"&":"&--"1/1/20"))))*(TRANSPOSE(ROW(INDIRECT(--"1/1/17"&":"&--"1/1/20")))<Before!$C$2:$C$77*(Before!$A$2:$A$77=A2))))
Bookmarks