A2
is =today()
, resolving to the date value of Apr-19
D2:2
(D2 and onwards to the right) are a list of datesA4
is a product that im expecting to be shippedD4:4
(D4 and onwards to the right) are the number of units of A4
im expecting to arrive by their corresponding date on row D2:AH
B4
to return the value from range D4:4
of the latest date that's more than A2
(today)A2
= Apr 19, then B4
= 130
(from Apr 23)A2
= Apr 22, then B4
= 130
(from Apr 23)A2
= Apr 23, then B4
= 0
(from Apr 24)I tried using INDEX and MATCH but I can't get the "Greater than today" part for match.
Thanks in advance.
I managed to get what I needed by combining CHOOSEROWS
, TOCOL
, and FILTER
from this answer and harun24hr's answer.
Here it is in action:
=CHOOSEROWS(TOCOL(FILTER(D4:4,D$2:$2>A$2),1),-1)