You must Sign In to post a response.
  • Category: Sharepoint

    If condition in sharepoint 2007 list

    Please suggest me on how to write if condition in share point list (for calculated column) example: if percentage is
    92-100=A1 grade
    83-91=A2 grade
    75-82=B1 grade
    67-74=B2 grade
    59-66=C1 grade
    51-58=C2 grade
    43-50=D1 grade
    35-42=D2 grade
    0-34=E grade
  • #741362


    you can use like below method

    =IF([Score]>89,"A",IF([Score]>79,"B", IF([Score]>69,"C",IF([Score]>59,"D","F"))))

    if any reference visit the below site

  • #741864
    Try this.....

    using (SPSite siteCol = new SPSite("http://server/sites/Contoso”))
    using (SPWeb web = siteCol.RootWeb)
    SPList list = web.GetList("/sites/Contoso/Lists/Books");

    SPListItem item = list.GetItemByIdSelectedFields(3, "calculated column Name");

    String myValue = (String)item["calculated column Name"];
    if(myValue>91, "A1", if(myValue>82, "A2", if(myValue>74, "B1", if(myValue>66, "B2", if(myValue>58, "C1",if(myValue>50, "C2",if(myValue>42, "D1",if(myValue>34, "D1","F"))))))))

  • Sign In to post your comments