Livestock rations are formulated to minimize feed cost subject to nutritional requirements for a target performance level, which ignores the potentially substantial cost of disposing of nutrients fed in excess of nutritional requirements. We incorporate nutrient disposal costs into a modified least-cost ration formulation model to arrive at a joint least-cost decision that minimizes the sum of feed and net nutrient disposal costs. The method is demonstrated with phosphorus disposal costs on a representative dairy farm. Herd size, land availability and proximity, crop rotation, and initial soil phosphorus content are shown to be important in determining phosphorus disposal costs.