0
votes

I'd like to match the date range label with specific dates.

I have a table with date range & label (in DateRange sheet):

enter image description here

I'd like to apply the label to the qualifying dates and results as such:

enter image description here

How can this be achieved with Google Sheets formula?

Example sheet: https://docs.google.com/spreadsheets/d/1O1rZUstDNSXPdUVXvaDfPO4rAQs2cJWHimfGxbddtNU/edit#gid=858702648

2
are you interested in non-dragging one cell solution? - player0
@player0 sure, that would be nice as well! - sojim2

2 Answers

1
votes
={"Name"; ARRAYFORMULA(IFERROR(IF(DATE(A2:A, B2:B, C2:C)<=MAX(DateRange!B:B), 
 IFERROR(VLOOKUP(DATE(A2:A, B2:B, C2:C), DateRange!A1:C, 3)), )))}

0

1
votes

One way (adapted from Web Applications) is, in F2 and copied down to suit:

=query(DateRange!A:C,"select C where A<=date '"&Text(date(A2,B2,C2),"yyyy-MM-dd")&"' and B>=date '"&text(date(A2,B2,C2),"yyyy-MM-dd")&"' ",0)