# Percentiles in Dynamic Array via Primary Keys

#### Josh123

##### New Member
Hi,

Summary: I need help calculating the 50th percentile of a given array where the array is determined by using a reference to a primary key.

Table 1 contains base salary values based on various positions associated with various companies. This table is structured so that the table header is the Company ID number and the rows are the Position ID number. Please see the following example:
 1 2 3 4 5 AAA 100 132 127 115 135 AAB 45 51 48 55 43

<tbody>
</tbody>

Table 2 contains a list of parameters and the Company ID the is associated with each parameter (the same Company ID may be used more than once due to the nature of the parameter). Please see the following example:
 Parameter Co. ID Criteria 1 1 Criteria 1 2 Criteria 1 3 Criteria 1 4 Criteria 1 5 Criteria 2 1 Criteria 2 2 Criteria 2 3 Criteria 2 4

<tbody>
</tbody>

My goal is to find the 50th percentile of the base for each position within Table 1 based on the specified parameters established within Table 2. From here, I will create a table that contains all Position IDs and all company Parameters where the Base Salary 50th Percentile will generate the value based on the combination of Column [A] and Column . The end goal will look something like this:
 [A]Position ID Parameter

<tbody>
[TD][C]Base Salary 50th Percentile[/TD]

[TR]
[TD]AAA[/TD]
[TD]Criteria 1[/TD]
[TD]127[/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD]Criteria 2[/TD]
[TD]121[/TD]
[/TR]
[TR]
[TD]AAB[/TD]
[TD]Criteria 1[/TD]
[TD]48[/TD]
[/TR]
[TR]
[TD]AAB[/TD]
[TD]Criteria 2[/TD]
[TD]50[/TD]
[/TR]
</tbody>

1,081,545
Messages
5,359,435
Members
400,528
Latest member
Ratish52

### This Week's Hot Topics

• VBA (Userform)
Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
• List box that changes fill color
Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
• Remove duplicates and retain one. Cross-linked cases
Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
• VBA Copy and Paste With Duplicates
Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
• Macro
is it possible for a macro to run if the active cell value is different to the value above it
• IF DATE and TIME
I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...