# Looking for a function to showcase different data depending on day

**URL:** <https://community.glideapps.com/t/looking-for-a-function-to-showcase-different-data-depending-on-day/2862>\
**Category:** Ask for Help\
**Created:** [December 13, 2019, 2:15pm UTC](https://community.glideapps.com/t/looking-for-a-function-to-showcase-different-data-depending-on-day/2862 "2019-12-13T14:15:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Menajem\_Benchimol](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/menajem_benchimol/32/1458_2.png) [@Menajem\_Benchimol](https://community.glideapps.com/u/Menajem_Benchimol)\
**Post date:** [December 13, 2019, 2:15pm UTC](https://community.glideapps.com/t/looking-for-a-function-to-showcase-different-data-depending-on-day/2862/1 "2019-12-13T14:15:33Z")

</div>

Hey guys,

I have a restaurant directory and was wondering how can I create a function that depending on the day, it shows what time the restaurant is open.

> **[NYC Kosher](https://nyckosher.glideapp.io/)**
>
> The complete directory of Kosher restaurants in NYC

For example:

Monday- 9AM- 5PM  
Tuesday 7AM-4PM etc.

@Jeff_Hager @George_B any takes?

Thanks.

---

<div class="post-metadata">

**Author:** ![George\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_b/32/534_2.png) [@George\_B](https://community.glideapps.com/u/George_B)\
**Post date:** [December 13, 2019, 2:31pm UTC](https://community.glideapps.com/t/looking-for-a-function-to-showcase-different-data-depending-on-day/2862/2 "2019-12-13T14:31:59Z")

</div>

Take a look at the sheet called Hours on this spreadsheet. That should do what you want. (Ignore the other tabs, I just tacked it on to this spreadsheet instead of creating a new one.)

> **[Badges by George\_B](https://docs.google.com/spreadsheets/d/1Q89_sxwo49ewpZja5wZ1FPu30GsONnAWCjVmThJ2SXg/edit?usp=sharing)**
>
> Badges
> 
> Badge id,Badge Names,Points required
> 1,Badge 1,250
> 2,Badge 2,400
> 3,Badge 3,550
> 4,Badge 4,100
> 5,Badge 5,300

---

<div class="post-metadata">

**Author:** ![Menajem\_Benchimol](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/menajem_benchimol/32/1458_2.png) [@Menajem\_Benchimol](https://community.glideapps.com/u/Menajem_Benchimol)\
**Post date:** [December 13, 2019, 2:58pm UTC](https://community.glideapps.com/t/looking-for-a-function-to-showcase-different-data-depending-on-day/2862/3 "2019-12-13T14:58:11Z")

</div>

Awesome,

Ill look at it, thank you so much George!

Last Q, what if restaurants have different hours, do I have to add something to the function?  
Also, I should put this on a separate tab, and on the column of a respective restaurant copy it?

I made this sheet for example: [https://docs.google.com/spreadsheets/d/1ted4gyZB5HsWr\_Yk9HlagY9E8kvwfWBTtgoDK7MNLw8/edit?usp=sharing](https://docs.google.com/spreadsheets/d/1ted4gyZB5HsWr_Yk9HlagY9E8kvwfWBTtgoDK7MNLw8/edit?usp=sharing)

I plan to use the “answer” and place it in another tab.

---

<div class="post-metadata">

**Author:** ![George\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_b/32/534_2.png) [@George\_B](https://community.glideapps.com/u/George_B)\
**Post date:** [December 13, 2019, 3:22pm UTC](https://community.glideapps.com/t/looking-for-a-function-to-showcase-different-data-depending-on-day/2862/4 "2019-12-13T15:22:49Z")

</div>

I guess you would have to list the hours for each restaurant in 7 columns on the restaurant individual details row. Then modify the formula a bit, probably use the hlookup() function instead of the lookup() that I used.

---

<div class="post-metadata">

**Author:** ![Menajem\_Benchimol](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/menajem_benchimol/32/1458_2.png) [@Menajem\_Benchimol](https://community.glideapps.com/u/Menajem_Benchimol)\
**Post date:** [December 13, 2019, 5:55pm UTC](https://community.glideapps.com/t/looking-for-a-function-to-showcase-different-data-depending-on-day/2862/5 "2019-12-13T17:55:20Z")

</div>

Awesome,  
Yea I added the data for each restaurant.

Thanks!

---

<div class="post-metadata">

**Author:** ![George\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_b/32/534_2.png) [@George\_B](https://community.glideapps.com/u/George_B)\
**Post date:** [December 13, 2019, 7:28pm UTC](https://community.glideapps.com/t/looking-for-a-function-to-showcase-different-data-depending-on-day/2862/6 "2019-12-13T19:28:54Z")

</div>

I had another light bulb moment. Check out the updated spreadsheet, sheet HoursRow, cell J1. That should work real well for you.

> **[Badges by George\_B](https://docs.google.com/spreadsheets/d/1Q89_sxwo49ewpZja5wZ1FPu30GsONnAWCjVmThJ2SXg/edit?usp=sharing)**
>
> Badges
> 
> Badge id,Badge Names,Points required
> 1,Badge 1,250
> 2,Badge 2,400
> 3,Badge 3,550
> 4,Badge 4,100
> 5,Badge 5,300

---

<div class="post-metadata">

**Author:** ![Menajem\_Benchimol](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/menajem_benchimol/32/1458_2.png) [@Menajem\_Benchimol](https://community.glideapps.com/u/Menajem_Benchimol)\
**Post date:** [December 13, 2019, 7:49pm UTC](https://community.glideapps.com/t/looking-for-a-function-to-showcase-different-data-depending-on-day/2862/7 "2019-12-13T19:49:55Z")

</div>

Woww that you so much!  
The main benefit is that with this new formula, you dont need a cell with the =today() function?

Pardon my ignorance

---

<div class="post-metadata">

**Author:** ![George\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_b/32/534_2.png) [@George\_B](https://community.glideapps.com/u/George_B)\
**Post date:** [December 14, 2019, 4:02am UTC](https://community.glideapps.com/t/looking-for-a-function-to-showcase-different-data-depending-on-day/2862/8 "2019-12-14T04:02:40Z")

</div>

The today() is within the formula. Look up the OFFSET() function in the Google Sheet docs to see how that works. The Weekday() function returns the day of the week for a given date. The date that is used is today(). The minus one is needed because of the zero based array that the Offset() function uses.

Keep in mind to make sure your spreadsheet has the proper Time Zone set in the File/Spreadsheet Settings. It should match what timezone all your restaurants are in. If you were to happen to have restaurants in different time zones you would have to factor that into the calculation by adding or subtracting the proper number of hours from what Today() is returning.

```auto
={"Todays Hrs";ARRAYFORMULA(OFFSET(C2:C,0,Weekday(today())-1))}

```

---

<div class="post-metadata">

**Author:** ![Menajem\_Benchimol](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/menajem_benchimol/32/1458_2.png) [@Menajem\_Benchimol](https://community.glideapps.com/u/Menajem_Benchimol)\
**Post date:** [December 17, 2019, 1:37am UTC](https://community.glideapps.com/t/looking-for-a-function-to-showcase-different-data-depending-on-day/2862/9 "2019-12-17T01:37:31Z")

</div>

I see, so far I am only adding restaurants in the NYC area, but will keep this in mind.

Thank you!
