sojim2
sojim2

Reputation: 1307

Match Date Range With Label

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

Upvotes: 0

Views: 288

Answers (2)

player0
player0

Reputation: 1

={"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

Upvotes: 1

pnuts
pnuts

Reputation: 59475

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)

Upvotes: 1

Related Questions