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

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?

-Shiv

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

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

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

-Shiv

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

2 Likes

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?

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

3 Likes