# Sales App - Follow-up Dates Filter

**URL:** <https://community.glideapps.com/t/sales-app-follow-up-dates-filter/8716>\
**Category:** Ask for Help\
**Created:** [May 8, 2020, 7:57am UTC](https://community.glideapps.com/t/sales-app-follow-up-dates-filter/8716 "2020-05-08T07:57:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adviuz](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@Adviuz](https://community.glideapps.com/u/Adviuz)\
**Post date:** [May 8, 2020, 7:57am UTC](https://community.glideapps.com/t/sales-app-follow-up-dates-filter/8716/1 "2020-05-08T07:57:26Z")

</div>

Hi Team Glide,

I have created an app for sales. I have follow-up date column in spreadsheet.

I want to filter follow-up dates as following

Today  
Tomorrow  
Yesterday  
Last 7 Days  
Upcoming 7 days  
Last 30 Days  
Upcoming 30 Days  
Custom Range

---

<div class="post-metadata">

**Author:** ![sardamit](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sardamit/32/263_2.png) [@sardamit](https://community.glideapps.com/u/sardamit)\
**Post date:** [May 8, 2020, 8:04am UTC](https://community.glideapps.com/t/sales-app-follow-up-dates-filter/8716/2 "2020-05-08T08:04:59Z")

</div>

You have to do this using a nested IF function in the Google Sheets document.

---

<div class="post-metadata">

**Author:** ![Guillaume\_RABALLAND](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/guillaume_raballand/32/35847_2.png) [@Guillaume\_RABALLAND](https://community.glideapps.com/u/Guillaume_RABALLAND)\
**Post date:** [December 8, 2021, 10:17pm UTC](https://community.glideapps.com/t/sales-app-follow-up-dates-filter/8716/3 "2021-12-08T22:17:53Z")

</div>

I used **Code \> Hyperformula** (Excel formula) for this directly in a Glide Data Editor _Computed column_.  
So it’s always computed when I add new data rows from my app (I couldn’t have this behavior using formulas in my original Google Sheets).  
For example in my case, I wanted to select dates for the last 14 days and the next 31 days (A1 is the given date you want to test, A2 is the number of days before now you would like to include, A3 is the number of days after now you would like to include):  
`=AND(A1-NOW()>-A2,A1-NOW()<A3)`

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/0/90ad53e0f4e2299522d395b1a1b164b1a4ade8c6.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 9, 2021, 1:40am UTC](https://community.glideapps.com/t/sales-app-follow-up-dates-filter/8716/4 "2021-12-09T01:40:38Z")

</div>

This can be done with Glide date math and an if-then-else column, without the need to use a plugin.  
Instead of using the number of days in a formula, you just need to determine the upper and lower bounds of the date range using a couple of math columns, eg:

- A2 = Now - 14
- A3 = Now + 31

Then the if-then-else column:

- If A1 is before A2 then empty
- If A1 is after A3 then empty
- Else true

---

<div class="post-metadata">

**Author:** ![Guillaume\_RABALLAND](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/guillaume_raballand/32/35847_2.png) [@Guillaume\_RABALLAND](https://community.glideapps.com/u/Guillaume_RABALLAND)\
**Post date:** [December 14, 2021, 6:11pm UTC](https://community.glideapps.com/t/sales-app-follow-up-dates-filter/8716/5 "2021-12-14T18:11:53Z")

</div>

Thanks, it’s prettier in this way with 3 simple columns instead of 1 with a formula !  
I couldn’t find a way to use the ‘today’ or ‘now’ value except in the specific field “DATE is before today” or “DATE is after today” in the if-then-else column, and it seems that the value can only be “today” and not “today -14”, so I turned it like this :

- A1 = target date (Date & Time column)
- A2 = A1 + 14 (Math Column)
- A3 = A1 - 31 (Math Column)

And in the If-then-else Column

- If A2 is before today then FALSE
- If A3 is after today then FALSE
- Else TRUE
