I am trying to use VLookup
or QUERY
to extract a day and time description based on the current date and time. I thought QUERY
may be the best here, but VLOOKUP
seems to be the best solution perhaps.
Is it possible to extract the date from between date and time ranges? The descriptions may change frequently so they can't be hardcoded into the formula.
Here is the Google Sheet, which can also be copied. https://docs.google.com/spreadsheets/d/1efQo1t9FJbItYdf1OQJ4vzeG1bUaQ1R0vbFGsgIjzOI/edit?usp=sharing
This was the current formula, which I hoped would extract the correct date and timeslot description
=ARRAYFORMULA(IFERROR(TEXT(A2:A, "dddd ")&VLOOKUP(TIMEVALUE(A2:A), {
TIMEVALUE(IFERROR(REGEXEXTRACT(TimeDescription!A2:A, "(.*) -"))), TimeDescription!B2:B}, 2, 1)))