What type of formula am I looking for?

Let say you have a list of items with 3 columns, two are statistical the third is just a name. The statistical categories you have are Points, and Salary. You have 10 different options. Each Row contains a Name, Points, Salary. You're looking to get the highest amount of points(X) total with an available salary(Y).
NOTE: Points have no correlation to salary.

Name   |   Points   | Salary
John   |     2      | 1,000
Jack   |     5.2    | 5,000
James  |     5      | 2,500
Jill   |     10     | 9,300
Jameson|     4      | 2,700
Ralph  |     2.1    | 6,700
Nate   |     8      | 3,800
Tim    |     7      | 5,000
Phil   |     6      | 3,600
Rick   |     7      | 1,350


How would I determine who are the 4 best options in terms of cumulative points if my salary is 20,000.

• Are you just looking for the name "knapsack problem"? – tabstop Feb 10 '14 at 23:43
• As tabstop said, this is the weighted knapsack problem, the wikipedia article en.wikipedia.org/wiki/Knapsack_problem should be a good starting point. – Josh Chen Feb 11 '14 at 0:18
• +1 to both tabstop and Josh. To add to their comments....there is no formula to solve this. In fact, its one of the most computationally difficult problems to solve (NP-complete). You will need to use a Binary Programming algorithm. – user76844 Feb 11 '14 at 4:36