5

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.

2
  • In which column did you apply this formula ? can you use simple SPD workflow? Commented Mar 3, 2020 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
    Commented Mar 3, 2020 at 10:17

3 Answers 3

1

Reading all your comments and inputs. I will suggest you to use below approach:

  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:

enter image description here

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:

  1. Calculated Field Formulas.
  2. IF function.
2
  • 1
    Yes!! Thank you. That was the solution. I needed to use semicolon(;) instead of comma(,). Thanks!
    – Mirte
    Commented Mar 5, 2020 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. Commented Mar 5, 2020 at 13:24
4

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)

enter image description here

Column A

enter image description here

FINAL

enter image description here

3

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)
2
  • 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
    Commented Mar 3, 2020 at 16:16
  • Yes, although you probably have to put the column name in square brackets, like =IF([Functie]="Stagiair", TRUE, FALSE)
    – willman
    Commented Mar 3, 2020 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.