Home > other >  search within a list of dates and find the next closest future date
search within a list of dates and find the next closest future date

Time:10-05

Question:

Given a list of pay periods and sales dates. For each sales date, determine the next pay day.

Pay periods (given) Sale date (given) Pay day (To be generated)
June 4 June 4 June 4
June 17 June 4 June 4
June 30 June 4 June 4
July 15 June 5 June 17
June 5 June 17
June 12 June 17
June 16 June 17
June 18 June 30
June 22 June 30
June 24 June 30
June 28 June 30
June 30 June 30
July 1 July 15
July 7 July 15
July 8 July 15
July 9 July 15
July 10 July 15

Google sheets sample

Hope it will be helpful.

CodePudding user response:

try:

=BYROW(B2:B, LAMBDA(x, SINGLE(FILTER(A2:A, A2:A>=x))))

enter image description here

or from another tab:

=BYROW(B2:B, LAMBDA(x, SINGLE(FILTER('New tab'!A2:A, 'New tab'!A2:A>=x))))
  • Related