title: Percentile in VBA
body: <p>Good morning the community,</p>
  
  <p>I am trying to code a macro in which I start from a an array in one tab, and in another tab, I write percentile computations (70%).
  In the picture attached, left side is my database, and right side is the result I would like to get:</p>
  
  <p><a href="https://i.stack.imgur.com/tHrg2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tHrg2.png" alt="enter image description here"></a></p>
  
  <p>I am stuck with the function itself and how to seperate each name.</p>
  
  <p>Thanks a lot for your help.</p>
  
  <pre><code> Sub Maths()
  Dim Result As Double
  Dim Apm As Worksheet
  Set Apm = Worksheets("SOURCE")
  Dim Bilan As Worksheet
  Set Bilan = Worksheets("bilan")
  
  Range("B2").Select
  Range(Selection, Selection.End(xlDown)).Select
  
  Data = Selection.Value
  
  'Clear worksheet Yield
  For i = 3 To 10
      For j = 1 To 5
              Bilan.Cells(i, j).ClearContents
      Next j
  Next i
  
  
              ' I use (1) and (2) below to test the copy/paste
              Bilan.Columns(1).Rows(2).Value = Apm.Columns.Rows(3).Value
              Bilan.Columns(2).Rows(2).Value = Application.WorksheetFunction.Percentile_Inc (Data, 0.68)
  
  MsgBox ("Work done")
  Bilan.Activate
  
  End Sub
  </code></pre>