I have a sheet - daily routine which has two columns: activity and time as shown here

Activity Time
Sleep 😴 6:00 am
Toilet 🚽 6:15 am
Get ready for gym 🤸‍♂️ 6:30 am
Exercise 💪 7:50 am
... more things 9:00 pm
... still more 10:45 pm
Sleep 😴 6:00 am

Here, say my toilet time would be from 6:00am to 6:15am I want to find out, say in C1 which activity is current for me using now() I.e., if it’s 6:45am on my watch, it should show me Exercise 💪 in C1

Using the if function for time comparison and a lookup should solve my requirement, right? Please help. How do I put the if function inside the lookup?

  • Hi and welcome to WebApps. Thank you very much for including your data, and for including it as text. This makes the work of volunteers so much easier
    – Tedinoz
    May 23 at 2:43

1 Answer 1


I'd use Index and Filter

(Filter () creates a list of upcoming tasks, Index () takes only the first of those)

=index(Filter(A2:A,timevalue(B2:B )>=timevalue(now())),1,1)

to get something like this:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.