Forum Discussion

Katia Laville's avatar
Katia Laville
Copper Contributor
Jun 21, 2017
Solved

Choose one approximate value between two dates

Hello everyone! I am working in a startup company within the real state industry. I would like to know if you could help me figure out a solution for this situation: I have potential clients who wi...
  • SergeiBaklan's avatar
    SergeiBaklan
    Jun 21, 2017

    Katia, forgot to check what's the logic with To field in column D. If empty cell means the landord available from "From" date till any date in future, when we have to add in criteria if in D is empty cell. Number of available landlords (H2) will be

     

    =SUMPRODUCT((C:C>0)*(C:C<=$F$2)*((D:D>=$G$2)+(D:D=0)))

    and the formula in F4 (and down after that) is

     

    =IF(
     ROWS(F$4:F4)<=$H$2,
     INDEX(B:B,
      SMALL(
       IF(C:C<=$F$2,
        IF((D:D>=$G$2)+(D:D=0),
         ROW(D:D)
        )
       ),
       ROWS(F$4:F4)
      )
     ),
     ""
    )

    File is attached.

     

Resources