locked
Calculated Value based on a Checkbox field RRS feed

  • Question

  • Hi All:

            This should be quite straightforward, but for some reason...

            I implement a calculated value with this expression: =IF(fieldName="Yes",1,0)

    and the data type returned from this formula is a number with 0 decimal places...

            Something particular about this, is that the fieldName field is a checkbox.

            It doesn't work, I only get 0s for all the values (Yes or No).

            I tryed again changing to =IF(fieldName="Yes","1","0") and data type returned string, but I get the same result...

            Can you realize what I am doing wrong?... It's just that I see it pretty well...

            Ok, thanks.


    Acaspita
    Monday, September 6, 2010 1:33 PM

Answers

  • Have you tried True/False and 1/0 in the comparison?  What is the value of the checkbox in the settings for that checkbox column?  Is it a boolean or choice fiied?  Basically, the results of the expression are telling you that fieldName is never equal to the text "Yes"
    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    Monday, September 6, 2010 11:36 PM

All replies

  • Have you tried True/False and 1/0 in the comparison?  What is the value of the checkbox in the settings for that checkbox column?  Is it a boolean or choice fiied?  Basically, the results of the expression are telling you that fieldName is never equal to the text "Yes"
    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    Monday, September 6, 2010 11:36 PM
  • Hello Clayton

    I have tried True/False and 1/0 and TRUE/FALSE and I didn't get a result

    any help

    Wednesday, February 6, 2013 12:39 PM
  • Hi Acaspita,

    I ran into the same problem.  Found the solution with this articles help.

    http://weblogs.asp.net/wesleybakker/archive/2010/08/08/sharepoint-calculated-field-from-string-to-number.aspx

    I was trying to count how many Yes's were amongst a list items checkbox fields.  Take your field [fieldname]+0 and it converts it to a number.  1 for yes, 0 for no.

    =SUM([Item 1]+0,[Item 2]+0,[Item 3]+0)

    Hope this solves your problem.

    Regards,

    Perry


    Perry Robertson



    • Edited by Perry Robertson Tuesday, March 26, 2013 7:14 PM typo
    • Proposed as answer by HK18 Friday, June 6, 2014 6:54 AM
    Tuesday, March 26, 2013 6:29 PM
  • Worked perfectly.Thanks a lot.
    Friday, May 16, 2014 7:39 PM