# 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:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![DareSteps](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daresteps/32/11716_2.png) [@DareSteps](https://community.glideapps.com/u/DareSteps)\
**Post date:** [December 17, 2020, 12:31am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/1 "2020-12-17T00:31:33Z")

</div>

A quick question gliders,  
Why If Then Else doesn’t work when you specify two math values?  
**Example 1** : I specified **if Timer is less than 0, show extra time.** (Only one criteria)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/6/e6a31f8c26878cc60d58a7a96ac3b7fa74cc85e7.png)

**Example 2** : **If extra is less than 0, then extra time. If equals or greater than 0, show timer.** in this example, all numbers got messed up! any solution for this?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/6/562876cec70433fdfec773715775e41fbca1abec.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:** [December 17, 2020, 12:36am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/2 "2020-12-17T00:36:03Z")

</div>

Seems like you were pointing to a math column with units specified for that column only. You should do the if then else with a template column.

---

<div class="post-metadata">

**Author:** ![DareSteps](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daresteps/32/11716_2.png) [@DareSteps](https://community.glideapps.com/u/DareSteps)\
**Post date:** [December 17, 2020, 12:41am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/3 "2020-12-17T00:41:40Z")

</div>

I see! I thought looking it up messes columns to I went to the original sheet and worked it out with no positive results. Now I can see if more than one criteria to be used in an If Then Else column, template must be used.

Thank you is not enough for you brother. God bless you, you helped me a big time.

---

<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:** [December 17, 2020, 12:43am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/4 "2020-12-17T00:43:24Z")

</div>

God bless you as well with your great work, my pleasure to help again.

---

<div class="post-metadata">

**Author:** ![DareSteps](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daresteps/32/11716_2.png) [@DareSteps](https://community.glideapps.com/u/DareSteps)\
**Post date:** [December 17, 2020, 12:52am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/5 "2020-12-17T00:52:18Z")

</div>

Actually I am trying to create teaching apps for IELTS as well as English students to help them make a difference. I really appreciate your patience. One day, when more and more students succeed, I will make sure they join this community and thank you in person.

---

<div class="post-metadata">

**Author:** ![Mns\_Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mns_glide/32/2514_2.png) [@Mns\_Glide](https://community.glideapps.com/u/Mns_Glide)\
**Post date:** [December 17, 2020, 1:54am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/6 "2020-12-17T01:54:37Z")

</div>

Is possible to show example of using template column for If-then-else?  
thanks

---

<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:** [December 17, 2020, 2:01am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/7 "2020-12-17T02:01:37Z")

</div>

It’s just a way of adding the units to the end of the number. The actual number column allows you to add units but they are kept specifically for that column and won’t transfer when you use an ITE on the number column, only the number part is transferred to the ITE result.

Hence I advised Mr. @DareSteps to have a template column to lock the units in.

---

<div class="post-metadata">

**Author:** ![DareSteps](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daresteps/32/11716_2.png) [@DareSteps](https://community.glideapps.com/u/DareSteps)\
**Post date:** [December 17, 2020, 4:53am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/8 "2020-12-17T04:53:24Z")

</div>

I would love to explain it to you as @ThinhDinh solved it.

I had an issue before. I wanted to use If Then Else for two MATH values, if it is less than zero, THEN Extra Timer. If it is equal or greater than zero, THEN Timer.

When it comes to IF THEN ELSE, if you want to use only one math value, it works perfect. Just like in Example 1. as you see the second value, if Timer equals or greater than 0, then (Left it empty) therefore If then else worked perfect.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/6/e6a31f8c26878cc60d58a7a96ac3b7fa74cc85e7.png)

Example 2: In this example, I didn’t leave the second value empty. In fact I wanted to run If Then Else for both two columns. Here is the issue, If Then Else didn’t work in this case. You must convert both math values to two TEMPLATES.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/6/562876cec70433fdfec773715775e41fbca1abec.png)

Example 3: I converted them to Template column now and they work perfectly.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/9/19d0dc81c0c02e38771adead417a055805e1843b.png)

If you mean I created Templates? here is an example: I already have Timer and Extra Time Templates. like this one:

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

I hope it helps. Please feel free to ask.

---

<div class="post-metadata">

**Author:** ![Mns\_Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mns_glide/32/2514_2.png) [@Mns\_Glide](https://community.glideapps.com/u/Mns_Glide)\
**Post date:** [December 17, 2020, 7:04am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/9 "2020-12-17T07:04:51Z")

</div>

thanks @DareSteps  
really helpful

---

<div class="post-metadata">

**Author:** ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)\
**Post date:** [December 17, 2020, 7:28am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/10 "2020-12-17T07:28:56Z")

</div>

Are you building timers in glide with loops using just the glide columns?

---

<div class="post-metadata">

**Author:** ![Mns\_Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mns_glide/32/2514_2.png) [@Mns\_Glide](https://community.glideapps.com/u/Mns_Glide)\
**Post date:** [December 17, 2020, 7:33am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/11 "2020-12-17T07:33:57Z")

</div>

no timer at moment…i am using timer for visibility control of buttons…i think that was resolved with help from our wonderful “Gurus” here…in If-then-else, i still have not got the hang of it yet, so a bit more knowledge will help to build better Apps.

---

<div class="post-metadata">

**Author:** ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)\
**Post date:** [December 17, 2020, 2:49pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/12 "2020-12-17T14:49:44Z")

</div>

Very nice, no one here has been brave enough to tackle timers directly in glide sheets just yet. We started a theoretical but I was hoping someone else wanted to give it a go.

---

<div class="post-metadata">

**Author:** ![DareSteps](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daresteps/32/11716_2.png) [@DareSteps](https://community.glideapps.com/u/DareSteps)\
**Post date:** [December 18, 2020, 3:19am UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/13 "2020-12-18T03:19:54Z")

</div>

What do you need timers for? I might be able to help you. Give me an example. I’ve created timers for Check in and out without specified times, I also set start and end time with timers. It all depends on what you are looking for.

---

<div class="post-metadata">

**Author:** ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)\
**Post date:** [December 23, 2020, 10:34pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/14 "2020-12-23T22:34:40Z")

</div>

It’s not something we can do in Glide just yet. I wanted to use a timer to rotate names in a list or remove names in a list when timers expire. It’s easy to do in google sheets but I want a countdown and instantaneous results which google sheets has a delay. But you would need timed events to be triggered.

---

<div class="post-metadata">

**Author:** ![Mns\_Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mns_glide/32/2514_2.png) [@Mns\_Glide](https://community.glideapps.com/u/Mns_Glide)\
**Post date:** [December 31, 2020, 2:04pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/15 "2020-12-31T14:04:44Z")

</div>

Happy 2021 to ALL,

This still bug me in 2020…

How do I implement logical AND in If-then-else? or What is best way to implement in Editor.

For example, we have two conditions and both must be true for it to be true. If either one condition is false then whole case will be false

My use case will be to check for two columns which are submitted by User. So if column A and column B is not empty then output should be True.

Thank you.

---

<div class="post-metadata">

**Author:** ![avanavana](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/avanavana/32/15637_2.png) [@avanavana](https://community.glideapps.com/u/avanavana)\
**Post date:** [December 31, 2020, 3:17pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/17 "2020-12-31T15:17:28Z")

</div>

One thing you can do is this:

Let’s say I have a two columns, `Hair` and `Eyes`, and I want an IF…ELSE column to display special text if a row has both ‘Blonde’ Hair and ‘Blue’ Eyes, (perhaps maybe this is a nazi app? ☹ )

1. Make separate IF…ELSE columns for each column `Hair` and `Eyes` that return the values either `1` if true or `0` if false. e.g. IF `Hair = 'Blonde'` THEN `1` ELSE `0` and IF `Eyes = 'Blue'` THEN `1` ELSE `0`.
2. Make a third MATH column that multiplies the two columns from step one together.
3. The result is: if both columns from step 1 are true (ie `AND` statement), `1*1=1`. But if any value is false, `1*0=0` or `0*1=0`, the AND statement is false. Therefore your final IF…ELSE column can say, if that MATH column (the result of multiplying the two IF…ELSE columns that each return either 0 or 1) is 1, then both of the original columns satisfy the `AND` condition.

---

<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:** [December 31, 2020, 4:02pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/18 "2020-12-31T16:02:30Z")

</div>

Sometimes you need to think about it differently. I like to call it ‘thinking backwards’. Sometimes it helps to look for the inverse of the value instead of looking for the actual value.

Using @avanavana’s example of wanting blonde hair and blue eyes, I would structure my If Then column like this.

IF Hair is not Blonde  
THEN false

ELSE

IF Eyes is not Blue  
THEN false

ELSE

true

This way, you will get a true result only if hair is blonde AND eyes are blue. The logic will continue through each condition until it finds a match. Otherwise it falls all the way through to the last ELSE.

In your case, it would be like this:

IF Column A is empty  
THEN false

ELSE

IF Column B is empty  
THEN false

ELSE

true

---

<div class="post-metadata">

**Author:** ![Mns\_Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mns_glide/32/2514_2.png) [@Mns\_Glide](https://community.glideapps.com/u/Mns_Glide)\
**Post date:** [January 1, 2021, 1:41pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/19 "2021-01-01T13:41:03Z")

</div>

@Jeff_Hager  
Thanks. Certainly made my day to look at inverse. Code is much neater also.

---

<div class="post-metadata">

**Author:** ![Mns\_Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mns_glide/32/2514_2.png) [@Mns\_Glide](https://community.glideapps.com/u/Mns_Glide)\
**Post date:** [January 1, 2021, 1:42pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/20 "2021-01-01T13:42:27Z")

</div>

@avanavana thanks. this will work, but @Jeff_Hager’s suggestion makes the code so much neater.

---

<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:21pm UTC](https://community.glideapps.com/t/if-then-else-with-two-or-more-criteria/19971/21 "2021-09-30T20:21:36Z")

</div>

Hi!

Maybe the following is a trivial one but I can’t get over it:

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

I only want to check if a date (an order date) is within a certian period of time (\>= Start AND \<= End).

Does not work. Any Ideas?  
And last, what’s the meaning of the “within” criteria? Shouldn’t it accept two dates, start and end?

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