6 Replies Latest reply on Dec 15, 2015 11:12 AM by Suman Inampudi

    Help on Calculated field (Like CountIF in Excel)

    Suman Inampudi

      Hi All,

       

      I need a help on creating a calculated column.

       

         

      QtyCodeCalculated Qty
      100450362902
      100450362902
      100450362902
      100450362902
      100450362902
      210450362903
      210450362903
      210450362903
      210450362903
      210450362903
      210450362903
      210450362903

       

       

      In the above set, i have qty 100 for code 450362902 and 210 for 450362903. In the calculated column i would like derive as Qty/No of occurrences for each code.

       

      In the above scenario calculated qty should be 100/5 for each row for 450362902 and 210/7 for 450362903.The output should look like below.

       

         

      QtyCodeCalculated Qty
      10045036290220
      10045036290220
      10045036290220
      10045036290220
      10045036290220
      21045036290330
      21045036290330
      21045036290330
      21045036290330
      21045036290330
      21045036290330
      21045036290330

       

       

      Can someone give me an idea on how to achieve this. In excel we do like this Qty / COUNTIF(column range,code) which gives you number of occurrences in that column.

       

      Thanks,

      Suman