Maximum Allowable Offer (MAO) Calculator

Maximum Allowable Offer (MAO) Calculator

function calculateMAO() { // Retrieve user inputs const ccrvArv = parseFloat(document.getElementById(‘ccrvArv’).value) || 0; const ccrvPercentage = parseFloat(document.getElementById(‘ccrvPercentage’).value) || 60; const rehabAmount = parseFloat(document.getElementById(‘rehabAmount’).value) || 0; const closingCosts = parseFloat(document.getElementById(‘closingCosts’).value) || 0; const desiredProfitPercentage = parseFloat(document.getElementById(‘desiredProfitPercentage’).value) || 0; const sellerPrice = parseFloat(document.getElementById(‘sellerPrice’).value) || 0; // Calculate the offer base from the percentage of CCRV / ARV const offerBase = (ccrvArv * (ccrvPercentage / 100)); // Calculate the desired profit based on percentage of the offer base const desiredProfit = (offerBase * (desiredProfitPercentage / 100)); // Calculate the initial MAO (Maximum Allowable Offer) let maxOffer = offerBase – rehabAmount – closingCosts – desiredProfit; // Calculate the bottom-line value (CCRV / ARV minus selected percentage of CCRV / ARV, rehab, and closing costs) const bottomLine = ccrvArv – (ccrvArv * (ccrvPercentage / 100)) – rehabAmount – closingCosts; // Check if the seller’s price exceeds the calculated MAO let resultMessage = ”; if (sellerPrice > maxOffer) { const priceDifference = sellerPrice – maxOffer; resultMessage = `

Seller’s requested price is ${priceDifference.toFixed(2)} more than your desired offer.

`; // Adjust desired profit to match the seller’s price const adjustedProfit = sellerPrice – offerBase – rehabAmount – closingCosts; resultMessage += `

Your desired profit will be adjusted to: $${adjustedProfit.toFixed(2)}

`; maxOffer = sellerPrice; // Set MAO to the seller’s price } else { resultMessage = `

Maximum Allowable Offer (MAO): $${maxOffer.toFixed(2)}

`; resultMessage += `

Your Desired Profit: $${desiredProfit.toFixed(2)}

`; } // Display the bottom-line calculation resultMessage += `

Bottom Line Calculation: $${bottomLine.toFixed(2)}

`; // Display the result document.getElementById(‘result’).innerHTML = resultMessage; }