# If Then Else with two or more criteria!

**URL:** <https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971>\
**Category:** Ask for Help\
**Created:** [December 17, 2020, 12:31am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971 "2020-12-17T00:31:33Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 30, 2021, 8:34pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/22 "2021-09-30T20:34:29Z")

</div>

Within means on that date (without time). It’s like an equal instead of a range.

Do any of your dates have an underlying time that is not midnight? Can you show what you have for values for your order date, start date and end date?

---

<div class="post-metadata">

**Author:** ![Makis\_Theonas](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/makis_theonas/32/713_2.png) [@Makis\_Theonas](https://community.glideapps.com/u/Makis_Theonas)\
**Post date:** [September 30, 2021, 8:41pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/23 "2021-09-30T20:41:44Z")

</div>

OrderDate (Date & Time / medium): 2021-09-19T11:12:35.978Z

StartDate (date only / short): 2021-09-18T00:00:00.000Z  
EndDate (date only / short): 2021-09-20T00:00:00.000Z

---

<div class="post-metadata">

**Author:** ![wjcv06](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wjcv06/32/12747_2.png) [@wjcv06](https://community.glideapps.com/u/wjcv06)\
**Post date:** [September 30, 2021, 10:09pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/25 "2021-09-30T22:09:52Z")

</div>

Test separating the conditions, then join them in a template column and validate based on that column.

If Validate = truetrue Then True Else False

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

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 30, 2021, 10:52pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/26 "2021-09-30T22:52:05Z")

</div>

So it returns 0 for your original setup?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [October 1, 2021, 12:17am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/27 "2021-10-01T00:17:28Z")

</div>

Looking at your IF column closer, are you sure you aren’t checking against Start date twice instead of start and end date?

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/0/20081b2a3733c6c89f20f273cc1af0c156da6c19.png)

Also, I’m not sure off the top of my head, but if ‘is before’ and ‘is after’ includes the time, then you might run into an issue if your order date happens to fall on the end date. So if you order date was on Sept 20th instead of the 19th, the 11:12 time is technically after midnight of the end time, which is Sept 20th. In a case like that, you may want to have a math column to add 1 day to your end date, so you end up with midnight of the next day, so your order date/time would still fall within range.

---

<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:** [October 1, 2021, 2:29am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/28 "2021-10-01T02:29:52Z")

</div>

> [@Makis\_Theonas](#):
>
> OrderDate (Date & Time / medium): 2021-09-19T11:12:35.978Z
> 
> StartDate (date only / short): 2021-09-18T00:00:00.000Z  
> EndDate (date only / short): 2021-09-20T00:00:00.000Z

Did you copy/paste those timestamps from the Glide Data Editor, or your Google Spreadsheet?  
If from the builder, try editing those columns and reset the date format.  
Experience has taught me that any time you see ISO formatted date/time strings in the GDE, it means that the date/time columns aren’t correctly configured. This usually happens when you’ve created the column in the Google Spreadsheet, filled it with dates, and allowed it to sync with Glide and then not set the formatting in the associated Glide columns.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [October 1, 2021, 2:44am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/29 "2021-10-01T02:44:50Z")

</div>

Hola,

Do you want this right?:

_StartDate \< OrderDate \< EndDate_

If so, you will need to create 2 (two) ITE columns to get it:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/f/af8d8354152f575a74729402b2e4acde79bf4032.png)

The first one looks like:

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/8/a8fcdd5bb52bd20e180f2b22d647ce8cd21f2942.png)

The other one looks:

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

Of course, you will have to change my " true" setting and use your “QTY” column instead.

I hope it helps!

Feliz noche.

---

<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:** [October 1, 2021, 2:54am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/30 "2021-10-01T02:54:13Z")

</div>

> [@gvalero](#):
>
> Do you want this right?:
> 
> _StartDate \< OrderDate \< EndDate_
> 
> If so, you will need to create 2 (two) ITE columns to get it:

hey man, no need for two columns. I do this _all_ the time…

- If OrderDate is before Start Date, then empty
- If OrderDate is after End Date, then empty
- Else true

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [October 1, 2021, 2:57am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/31 "2021-10-01T02:57:28Z")

</div>

let me see! I tested it days ago and never worked for me 🤥

I will be back soon Darren

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [October 1, 2021, 3:19am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/32 "2021-10-01T03:19:27Z")

</div>

WTF??? It’s working 😂

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/2/22a489bb25e66e501ba67d8ca9da0872fa8cf66c.png)

I don’t know what happened to me those nights but I’m happy to know today that I was wrong.

Thanks a lot for this new notice!

Gracias Darren 👍

---

<div class="post-metadata">

**Author:** ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)\
**Post date:** [January 17, 2024, 4:50pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/33 "2024-01-17T16:50:22Z")

</div>

Closed on January 17, 2024, 4:50pm UTC



[Previous page](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971.md?page=1)
