In a spreadsheet I have a column of dates (column r).
I have a formula in a cell
=INDEX($R$4:$R$57, MATCH(MIN(ABS($R$4:$R$57-$H$7)), ABS($R$4:$R$57-$H$7), 0))
Which is looking for the nearest date in column r (my list) to the date in H7. This has been working fine but I now need to tweak it a bit to look for the nearest date, but not past the date in H7.
I'm not sure which bit of this formula I should tweak - or if indeed it can be tweaked to do this.
I thought about something like
=INDEX(R4:R57, MATCH(MIN(IF(R4:R57-$H$7<=0, R4:R57-$H$7, "")), R4:R57-$H$7, 0))
but this just returns the first entry in R4 everytime no mater what the date in h7
As always any help appreciated.
I have a formula in a cell
=INDEX($R$4:$R$57, MATCH(MIN(ABS($R$4:$R$57-$H$7)), ABS($R$4:$R$57-$H$7), 0))
Which is looking for the nearest date in column r (my list) to the date in H7. This has been working fine but I now need to tweak it a bit to look for the nearest date, but not past the date in H7.
I'm not sure which bit of this formula I should tweak - or if indeed it can be tweaked to do this.
I thought about something like
=INDEX(R4:R57, MATCH(MIN(IF(R4:R57-$H$7<=0, R4:R57-$H$7, "")), R4:R57-$H$7, 0))
but this just returns the first entry in R4 everytime no mater what the date in h7
As always any help appreciated.