# How to decide 3rd Boolean based on 2 Boolean values

**URL:** <https://community.glideapps.com/t/how-to-decide-3rd-boolean-based-on-2-boolean-values/29215>\
**Category:** Ask for Help\
**Created:** [July 17, 2021, 2:01pm UTC](https://community.glideapps.com/t/how-to-decide-3rd-boolean-based-on-2-boolean-values/29215 "2021-07-17T14:01:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shiv](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shiv/32/25831_2.png) [@Shiv](https://community.glideapps.com/u/Shiv)\
**Post date:** [July 17, 2021, 2:01pm UTC](https://community.glideapps.com/t/how-to-decide-3rd-boolean-based-on-2-boolean-values/29215/1 "2021-07-17T14:01:03Z")

</div>

I have 2 boolean columns and I want to compute a 3rd boolean column based on the values in the first two. I realized I can’t do that using IF-THEN-ELSE as there is no AND condition to merge 2 columns ( if am using it right ).

A and B are my existing and I want to set the value of C based on the previous 2 values.

I have set the visibility of B based on my value of A. But my catch here is that a user can set B as TRUE and then A as TRUE where the value of B gets saved (as TRUE) which I don’t want.

What I want

A B C  
0 0 0  
0 1 1  
1 0 0  
1 1 0

What is the approach that I should take?

Thanks in advance.

-Shiv

---

<div class="post-metadata">

**Author:** ![Shiv](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shiv/32/25831_2.png) [@Shiv](https://community.glideapps.com/u/Shiv)\
**Post date:** [July 17, 2021, 2:04pm UTC](https://community.glideapps.com/t/how-to-decide-3rd-boolean-based-on-2-boolean-values/29215/2 "2021-07-17T14:04:41Z")

</div>

I tried an if-then-else where if A is TRUE then am setting C as FALSE. But in this situation when i set A as FALSE and B as TRUE then C is not coming as TRUE ( which is my primary expectation ).

-Shiv

---

<div class="post-metadata">

**Author:** ![Marc-Olivier](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@Marc-Olivier](https://community.glideapps.com/u/Marc-Olivier)\
**Post date:** [July 17, 2021, 2:21pm UTC](https://community.glideapps.com/t/how-to-decide-3rd-boolean-based-on-2-boolean-values/29215/3 "2021-07-17T14:21:35Z")

</div>

Hey there

Very easy you can add two booleans each true boolean is one. So you do a math column and you do 2 times boolean A + 1 time boolean B.

A B C (=2\*A+B)  
0 0 0  
0 1 1  
1 0 2  
1 1 3  
et voilà 🙂  
Marco

---

<div class="post-metadata">

**Author:** ![Shiv](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shiv/32/25831_2.png) [@Shiv](https://community.glideapps.com/u/Shiv)\
**Post date:** [July 17, 2021, 2:50pm UTC](https://community.glideapps.com/t/how-to-decide-3rd-boolean-based-on-2-boolean-values/29215/4 "2021-07-17T14:50:21Z")

</div>

> [@Marc-Olivier](#):
>
> So you do a math column and you do 2 times boolean A + 1 time boolean B.

@Marc-Olivier But what you are showing gives me C as a numerical value but i need a Boolean value.

-Shiv

---

<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:** [July 17, 2021, 2:56pm UTC](https://community.glideapps.com/t/how-to-decide-3rd-boolean-based-on-2-boolean-values/29215/5 "2021-07-17T14:56:48Z")

</div>

If B is False Then False  
ElseIf A is True Then False  
Else True

---

<div class="post-metadata">

**Author:** ![Marc-Olivier](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@Marc-Olivier](https://community.glideapps.com/u/Marc-Olivier)\
**Post date:** [July 17, 2021, 3:16pm UTC](https://community.glideapps.com/t/how-to-decide-3rd-boolean-based-on-2-boolean-values/29215/6 "2021-07-17T15:16:36Z")

</div>

So you want false and not true when both A and B (accidently) are true as B appears when A is set to true. Is that right?

---

<div class="post-metadata">

**Author:** ![Shiv](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shiv/32/25831_2.png) [@Shiv](https://community.glideapps.com/u/Shiv)\
**Post date:** [July 17, 2021, 3:19pm UTC](https://community.glideapps.com/t/how-to-decide-3rd-boolean-based-on-2-boolean-values/29215/7 "2021-07-17T15:19:49Z")

</div>

> [@Jeff\_Hager](#):
>
> If B is False Then False  
> ElseIf A is True Then False  
> Else True

YES YES YES - this worked 🙂

Took me a while to figure out how it worked but yes it does what i wanted to.

Thanks a ton @Jeff_Hager

-Shiv

---

<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:51pm UTC](https://community.glideapps.com/t/how-to-decide-3rd-boolean-based-on-2-boolean-values/29215/8 "2024-01-17T16:51:24Z")

</div>


