# If A = 2, then set B to yes

Say, I have a SharePoint list with 2 columns, A and B. A contains a list with three items: choice 1, choice 2 and choice 3. B is a yes/no (true/false) field.

I would like to formulate an condition that does this: If A = 2, then set B to yes.

I am new to the formulas, hence the question. I tried some things like: `=If([A]="2","true", "false")` Did not work.

• In which column did you apply this formula ? can you use simple SPD workflow? – Karthik Jaganathan Mar 3 '20 at 9:23
• I applied the formula in column B. I haven't tried to use the workflow because i would first like to practice some more in formulas. – Mirte Mar 3 '20 at 10:17

1. Create a new calculated column with name B (or whatever the real name you want to give it).
2. In the formula section use the below formula:
``````=IF([Functie]="Stagiair",TRUE,FALSE)

``````

Calculated Column Settings:

Note:

1. Sometimes comma(`,`) does not work in formula (I am not sure but it is based on something language or regional settings on your site). So in that case use semicolon(`;`) instead of comma(`,`).
2. Select The data type returned from this formula is in your calculated field settings as Yes/No.

Official documentations:

• Yes!! Thank you. That was the solution. I needed to use semicolon(;) instead of comma(,). Thanks! – Mirte Mar 5 '20 at 10:24
• Please Upvote(^) and accept as an Answer as it helped you and it will be easy for others to find the correct solution easily in future. – Ganesh Sanap Mar 5 '20 at 13:24

Your A column is choice field with Choices (1, 2, 3).

Your B column is Calculated field with type Yes/No.

For B column calculation formula is:

``````=IF(A="2",TRUE,FALSE)
``````

Column A

FINAL

You are close, but you only need to enclose your values in quotes if you need the values evaluated as strings.
Assuming you configured column `'A'` as a numeric field type, and you have configured '`B'` as a Calculated column with a Boolean (yes/no) output, then the following should work:

``````=If([A]=2, TRUE, FALSE)
``````
• I cannot get this to work. After I try to save it, it says that the formula has an syntaxerror. The column A is called Functie, and one of the values to choose from is Stagiair. So the're strings. I This should do it, right? =If(Functie="Stagiair",TRUE, FALSE) – Mirte Mar 3 '20 at 16:16
• Yes, although you probably have to put the column name in square brackets, like `=IF([Functie]="Stagiair", TRUE, FALSE)` – willman Mar 3 '20 at 17:17