One Acre Fund interview question

Order optimization problem in Excel