Determine the discount rate where NPVs of two projects are equal.
Project A Cash Flows
*Enter as negative number
Project B Cash Flows
*Enter as negative number
Calculation Result
The Crossover Rate is:
0.00%
At this discount rate, both Project A and Project B have the same Net Present Value (NPV).
// Helper function to calculate NPV for a given rate and array of flows
function calculateNPV(rate, cashFlows) {
var npv = 0;
for (var i = 0; i < cashFlows.length; i++) {
npv += cashFlows[i] / Math.pow(1 + rate, i);
}
return npv;
}
// Helper function to calculate the derivative of NPV (for Newton-Raphson)
function calculateNPVDerivative(rate, cashFlows) {
var derivative = 0;
for (var i = 1; i < cashFlows.length; i++) {
derivative -= i * cashFlows[i] / Math.pow(1 + rate, i + 1);
}
return derivative;
}
// IRR Calculation using Newton-Raphson method
function calculateIRR(cashFlows, guess) {
var maxIterations = 1000;
var precision = 0.0000001;
var rate = guess;
for (var i = 0; i < maxIterations; i++) {
var npv = calculateNPV(rate, cashFlows);
var derivative = calculateNPVDerivative(rate, cashFlows);
if (Math.abs(derivative) < precision) {
return null; // Avoid division by zero
}
var newRate = rate – (npv / derivative);
if (Math.abs(newRate – rate) < precision) {
return newRate;
}
rate = newRate;
}
return null; // Failed to converge
}
function calculateCrossover() {
// Hide previous results/errors
document.getElementById("result-area").style.display = "none";
document.getElementById("errorMsg").style.display = "none";
// Gather Inputs
var projectA = [];
var projectB = [];
var differentialFlows = [];
var isValid = true;
for (var i = 0; i <= 5; i++) {
var valA = parseFloat(document.getElementById("pA_" + i).value);
var valB = parseFloat(document.getElementById("pB_" + i).value);
if (isNaN(valA) || isNaN(valB)) {
isValid = false;
break;
}
projectA.push(valA);
projectB.push(valB);
// Crossover logic: The IRR of the DIFFERENCE between cash flows (A – B)
differentialFlows.push(valA – valB);
}
if (!isValid) {
var err = document.getElementById("errorMsg");
err.innerHTML = "Please enter valid numbers for all cash flow fields.";
err.style.display = "block";
return;
}
// Check if there is at least one sign change in differential flows
// IRR cannot be calculated if all values are positive or all are negative
var positiveCount = 0;
var negativeCount = 0;
for (var j = 0; j 0) positiveCount++;
if (differentialFlows[j] < 0) negativeCount++;
}
if (positiveCount === 0 || negativeCount === 0) {
var err = document.getElementById("errorMsg");
err.innerHTML = "No Crossover Rate exists. The NPV profiles do not intersect (differential cash flows do not change sign).";
err.style.display = "block";
return;
}
// Calculate IRR of the differential flows
// We guess 0.1 (10%) as a starting point
var crossoverRate = calculateIRR(differentialFlows, 0.1);
if (crossoverRate === null || isNaN(crossoverRate) || !isFinite(crossoverRate)) {
// Try a different guess if first fails
crossoverRate = calculateIRR(differentialFlows, -0.1);
if (crossoverRate === null) {
var err = document.getElementById("errorMsg");
err.innerHTML = "Could not calculate a valid crossover rate for these inputs.";
err.style.display = "block";
return;
}
}
// Display Result
var percentage = (crossoverRate * 100).toFixed(4);
document.getElementById("crossoverResult").innerText = percentage + "%";
var explanation = "At " + percentage + "%, the Net Present Value of Project A is " +
calculateNPV(crossoverRate, projectA).toFixed(2) +
" and Project B is " +
calculateNPV(crossoverRate, projectB).toFixed(2) + ".";
document.getElementById("resultText").innerText = explanation;
document.getElementById("result-area").style.display = "block";
}
What is the Crossover Rate?
In capital budgeting, the Crossover Rate is the specific discount rate at which the Net Present Value (NPV) of two mutually exclusive projects is exactly the same. It is the point where the NPV profiles of two investment opportunities intersect.
Financial analysts use this metric to decide between projects when there is a ranking conflict. For example, Project A might have a higher NPV at low discount rates, while Project B has a higher NPV at high discount rates. The Crossover Rate defines the threshold between these two scenarios.
How the Crossover Rate Calculator Logic Works
While this tool runs directly in your browser, it replicates the logic used when building a "Crossover Rate Calculator in Excel". The mathematical process involves three steps:
List Cash Flows: Organize the initial investment (Year 0) and subsequent annual cash flows for both Project A and Project B.
Calculate Differential Cash Flows: Subtract the cash flow of Project B from Project A for every period ($CF_{Diff} = CF_A – CF_B$).
Compute IRR: Calculate the Internal Rate of Return (IRR) on the stream of differential cash flows. This resulting IRR is the Crossover Rate.
Excel Formula Equivalent:
=IRR(Range_Project_A – Range_Project_B)
Why is this Important?
When comparing two projects, you might encounter a situation where:
Project A has a higher IRR (Internal Rate of Return).
Project B has a higher NPV (Net Present Value).
This conflict often arises due to differences in the scale of investment or the timing of cash flows. The Crossover Rate helps you understand the sensitivity of your decision to the cost of capital. If your company's Weighted Average Cost of Capital (WACC) is below the crossover rate, you should generally choose the project with the steeper NPV profile (often the one with larger total cash flows). If the WACC is above the crossover rate, the project with the lower initial outlay or faster payback might be superior.
Example Scenario
Consider the default values in the calculator above:
Year
Project A
Project B
Differential (A – B)
0
-10,000
-15,000
+5,000
1-5
4,000
5,500
-1,500
In this scenario, calculating the IRR of the "Differential" column (+5,000 followed by five payments of -1,500) yields the crossover rate. This tells you exactly at what interest rate you would be indifferent between investing in Project A or Project B.