Michael LaMarche
Michael LaMarche

Reputation: 45

How can I Find a Date Between Two Dates and Return a Holiday?

I have a Google Sheet that has a list of holidays with their corresponding dates.

I need a formula that will return the name of the holiday (column B) if the date falls between two dates (column D and E).

Here is the Google Sheet:

Upvotes: 2

Views: 420

Answers (1)

Mike Steelson
Mike Steelson

Reputation: 15328

Try

=if(sumproduct((D2<=$A$2:$A$26)*(E2>=$A$2:$A$26)),"Holiday","")

to get which holiday(s) and check multiple occurrences within the same period

=iferror(textjoin(" + ",true,unique(query(A:B,"select B where A>=DATE'"&TEXT(D2,"yyyy-MM-dd")&"' and A<=DATE'"&TEXT(E2,"yyyy-MM-dd")&"' ",0))))

Upvotes: 0

Related Questions