Debt Weight for Wacc Calculation

Debt Weight for WACC Calculation: Formula, Examples & Calculator :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –light-gray: #e9ecef; –white: #fff; –border-color: #ccc; –shadow-color: rgba(0, 0, 0, 0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; } main { width: 100%; max-width: 980px; margin: 20px auto; padding: 0 20px; box-sizing: border-box; } header { background-color: var(–primary-color); color: var(–white); padding: 20px 0; text-align: center; width: 100%; } header h1 { margin: 0; font-size: 2.5em; } .container { background-color: var(–white); padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px var(–shadow-color); margin-bottom: 30px; } h1, h2, h3 { color: var(–primary-color); } h1 { font-size: 2em; margin-bottom: 20px; } h2 { font-size: 1.7em; margin-top: 30px; margin-bottom: 15px; border-bottom: 2px solid var(–light-gray); padding-bottom: 5px; } h3 { font-size: 1.3em; margin-top: 20px; margin-bottom: 10px; } .loan-calc-container { background-color: var(–white); padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px var(–shadow-color); margin-bottom: 30px; } .input-group { margin-bottom: 20px; text-align: left; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group input[type="text"], .input-group select { width: calc(100% – 24px); padding: 12px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; box-sizing: border-box; } .input-group input:focus, .input-group select:focus { outline: none; border-color: var(–primary-color); box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.2); } .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; display: block; } .error-message { color: #dc3545; font-size: 0.9em; margin-top: 5px; display: block; height: 1.2em; /* Reserve space */ } .results-container { background-color: var(–primary-color); color: var(–white); padding: 25px; border-radius: 8px; margin-top: 20px; box-shadow: 0 4px 10px rgba(0, 74, 153, 0.3); text-align: center; } .results-container h3 { color: var(–white); margin-top: 0; font-size: 1.5em; } .main-result { font-size: 2.5em; font-weight: bold; margin: 15px 0; padding: 10px; background-color: rgba(255, 255, 255, 0.15); border-radius: 5px; } .intermediate-results div { margin-bottom: 10px; font-size: 1.1em; } .intermediate-results span { font-weight: bold; margin-left: 5px; } .formula-explanation { font-size: 0.9em; color: rgba(255, 255, 255, 0.8); margin-top: 15px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.2); } .button-group { text-align: center; margin-top: 25px; } button { background-color: var(–primary-color); color: var(–white); border: none; padding: 12px 25px; border-radius: 5px; font-size: 1.1em; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; margin: 5px; } button:hover { background-color: #003366; transform: translateY(-2px); } button.reset { background-color: var(–light-gray); color: var(–text-color); } button.reset:hover { background-color: #ccc; } button.copy { background-color: var(–success-color); } button.copy:hover { background-color: #218838; } table { width: 100%; border-collapse: collapse; margin-top: 20px; margin-bottom: 30px; } th, td { border: 1px solid var(–border-color); padding: 12px; text-align: left; } th { background-color: var(–light-gray); color: var(–primary-color); font-weight: bold; } td { background-color: var(–white); } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; text-align: left; } .chart-container { width: 100%; max-width: 700px; margin: 20px auto; text-align: center; } canvas { display: block; margin: 0 auto; } .chart-caption { font-size: 0.9em; color: #666; margin-top: 10px; } .article-section { background-color: var(–white); padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px var(–shadow-color); margin-bottom: 30px; text-align: left; } .article-section p { margin-bottom: 15px; } .article-section ul, .article-section ol { margin-left: 20px; margin-bottom: 15px; } .article-section li { margin-bottom: 8px; } .faq-item { margin-bottom: 15px; } .faq-question { font-weight: bold; color: var(–primary-color); margin-bottom: 5px; cursor: pointer; } .faq-answer { display: none; padding-left: 10px; border-left: 3px solid var(–light-gray); margin-top: 5px; } .internal-links ul { list-style: none; padding: 0; } .internal-links li { margin-bottom: 15px; } .internal-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .internal-links a:hover { text-decoration: underline; } .internal-links p { font-size: 0.9em; color: #555; margin-top: 5px; } @media (max-width: 768px) { header h1 { font-size: 1.8em; } .container, .loan-calc-container, .article-section { padding: 20px; } button { width: 90%; margin: 5px auto; display: block; } }

Debt Weight for WACC Calculation

Understanding Your Capital Structure's Cost

WACC Debt Weight Calculator

Enter the total market value of all your company's debt.
Enter the total market value of all your company's equity.
Enter your company's effective corporate tax rate.

Calculation Results

Debt Weight:
Equity Weight:
After-Tax Cost of Debt Weight:
Debt Weight = Total Debt Value / (Total Debt Value + Total Equity Value)
Equity Weight = Total Equity Value / (Total Debt Value + Total Equity Value)
The Debt Weight is the proportion of your company's financing that comes from debt.

What is Debt Weight for WACC Calculation?

The debt weight for WACC calculation refers to the proportion of a company's total market value of capital that is financed by debt. In simpler terms, it's the percentage of your company's funding that comes from borrowing money, as opposed to equity. This metric is a crucial component in calculating the Weighted Average Cost of Capital (WACC), which represents a company's blended cost of all its capital sources (debt and equity). Understanding your debt weight is fundamental for financial analysis, investment decisions, and assessing the overall financial health and risk profile of a business. It helps stakeholders gauge how reliant a company is on leverage.

Who should use it: Financial analysts, corporate finance managers, investors, business owners, and students learning about corporate finance and capital budgeting will find this metric invaluable. It's used in valuations, determining the appropriate discount rate for investment projects, and strategic financial planning. Anyone evaluating a company's cost of capital needs to understand its capital structure, and debt weight is a key part of that.

Common Misconceptions:

  • Confusing Market Value with Book Value: Debt weight should ideally be calculated using the market values of debt and equity, not their book values. Market values reflect current economic conditions and investor perceptions, which are more relevant for WACC.
  • Ignoring Tax Shield: Many mistakenly believe the debt weight simply uses the pre-tax cost of debt. However, for WACC, the interest payments on debt are tax-deductible, creating a "tax shield" that reduces the effective cost of debt. This is indirectly accounted for in WACC by using the debt weight in conjunction with the after-tax cost of debt.
  • Assuming Constant Weights: A company's debt weight isn't static; it changes with market conditions, new debt or equity issuance, and stock price fluctuations.

Debt Weight for WACC Calculation Formula and Mathematical Explanation

The calculation of debt weight is straightforward, focusing on the market values of a company's financing components. It's the first step in determining the structure of your WACC.

The Core Formula:

The weight of debt (often denoted as 'Wd' or 'w_debt') is calculated as follows:

Debt Weight = Total Market Value of Debt / (Total Market Value of Debt + Total Market Value of Equity)

Similarly, the weight of equity (often denoted as 'We' or 'w_equity') is:

Equity Weight = Total Market Value of Equity / (Total Market Value of Debt + Total Market Value of Equity)

Note that the sum of the debt weight and equity weight will always equal 1 (or 100%).

Variable Explanations:

  • Total Market Value of Debt: This is the current market price of all outstanding debt obligations of the company. This includes bonds, loans, and other forms of borrowing. For publicly traded bonds, it's their market price multiplied by the face value. For bank loans, it's often the outstanding principal balance, assumed to be close to market value unless interest rates have drastically changed since issuance.
  • Total Market Value of Equity: This is the current market capitalization of the company. It's calculated by multiplying the current share price by the total number of outstanding shares.
  • Corporate Tax Rate: This is the company's effective or marginal tax rate. It's used to calculate the "tax shield" benefit of debt in the WACC formula (though not directly in the debt weight calculation itself, it's intrinsically linked to the WACC calculation).

Variable Table:

Variables Used in Debt Weight Calculation
Variable Meaning Unit Typical Range
Total Market Value of Debt Current market value of all debt financing. Currency (e.g., USD, EUR) > 0
Total Market Value of Equity Current market capitalization of the company. Currency (e.g., USD, EUR) > 0
Debt Weight (Wd) Proportion of total capital financed by debt. Decimal (0 to 1) or Percentage (0% to 100%) 0 to 1 (or 0% to 100%)
Equity Weight (We) Proportion of total capital financed by equity. Decimal (0 to 1) or Percentage (0% to 100%) 0 to 1 (or 0% to 100%)
Corporate Tax Rate Company's effective tax rate. Percentage (%) Typically 15% to 35%, but varies by jurisdiction.

The calculated debt weight for WACC calculation directly influences how much weight the cost of debt (after tax) and the cost of equity contribute to the overall WACC. A higher debt weight means the cost of debt has a larger impact.

Practical Examples (Real-World Use Cases)

Let's illustrate the calculation of debt weight with two distinct scenarios.

Example 1: Mature Technology Company

Company Profile: "Innovatech Solutions," a publicly traded tech company with a stable revenue stream.

Inputs:

  • Total Market Value of Debt: $75,000,000
  • Total Market Value of Equity: $225,000,000
  • Corporate Tax Rate: 25%

Calculation:

  • Total Capital = $75,000,000 (Debt) + $225,000,000 (Equity) = $300,000,000
  • Debt Weight = $75,000,000 / $300,000,000 = 0.25
  • Equity Weight = $225,000,000 / $300,000,000 = 0.75

Results & Interpretation:

  • Debt Weight: 25%
  • Equity Weight: 75%
Innovatech Solutions has a debt weight of 25%. This indicates that 25% of its total capital is financed through debt. Consequently, 75% is financed by equity. This capital structure suggests a relatively conservative financing approach, with a lower reliance on leverage compared to equity. This typically implies lower financial risk but potentially a higher cost of capital if equity is more expensive than debt.

Example 2: Growing Manufacturing Firm

Company Profile: "Global Manufacturing Inc.," a rapidly expanding firm funding its growth through significant borrowing.

Inputs:

  • Total Market Value of Debt: $150,000,000
  • Total Market Value of Equity: $100,000,000
  • Corporate Tax Rate: 21%

Calculation:

  • Total Capital = $150,000,000 (Debt) + $100,000,000 (Equity) = $250,000,000
  • Debt Weight = $150,000,000 / $250,000,000 = 0.60
  • Equity Weight = $100,000,000 / $250,000,000 = 0.40

Results & Interpretation:

  • Debt Weight: 60%
  • Equity Weight: 40%
Global Manufacturing Inc. has a debt weight of 60%. This signifies a heavier reliance on debt financing to fund its operations and expansion. While using debt can potentially increase returns to shareholders (due to the tax shield and leverage), it also significantly increases financial risk. Lenders and investors will scrutinize this capital structure closely.

How to Use This Debt Weight for WACC Calculator

Our intuitive calculator simplifies the process of determining your company's debt weight. Follow these simple steps to get accurate results:

  1. Input Total Debt Value: Enter the current aggregate market value of all your company's outstanding debt. This includes bonds, loans, and any other interest-bearing liabilities. Ensure you use the market value, not the face value if market prices differ significantly.
  2. Input Total Equity Value: Enter the current total market value of your company's equity. For publicly traded companies, this is simply the market capitalization (share price multiplied by shares outstanding). For private companies, it requires an estimation of the current valuation.
  3. Input Corporate Tax Rate: Provide your company's effective or marginal corporate income tax rate as a percentage (e.g., 21 for 21%). This is essential for the full WACC calculation, though only the debt and equity values are used for the debt weight itself.
  4. Click 'Calculate': Once all values are entered, click the "Calculate" button. The calculator will instantly compute the debt weight, equity weight, and the after-tax cost of debt weight (a precursor to WACC).

How to Read Results:

  • Debt Weight: This is your primary result, expressed as a percentage. It tells you the proportion of your company's capital structure that comes from debt.
  • Equity Weight: This shows the proportion of capital financed by equity. It should always sum to 100% with the debt weight.
  • After-Tax Cost of Debt Weight: This intermediate value represents the debt weight multiplied by the after-tax cost of debt. It's a component used directly in the WACC formula.
  • Main Highlighted Result: This typically displays the calculated Debt Weight prominently.

Decision-Making Guidance:

A higher debt weight suggests increased financial leverage and potentially higher risk, but also the possibility of amplified returns to shareholders due to the tax deductibility of interest. Conversely, a lower debt weight indicates a more conservative capital structure, generally associated with lower financial risk but potentially missing out on the benefits of leverage. Use these insights to inform decisions about future financing strategies, project feasibility studies (by providing input for WACC), and assessing your company's risk profile against industry benchmarks. Understanding your debt weight for WACC calculation is key to optimizing your firm's overall cost of capital.

Key Factors That Affect Debt Weight Results

Several factors can influence the calculated debt weight and, consequently, the WACC. Understanding these dynamics is crucial for accurate financial modeling and strategic decision-making.

  1. Market Conditions for Debt: Interest rate fluctuations directly impact the market value of existing debt. If interest rates rise, the market value of outstanding bonds generally falls, potentially decreasing the total market value of debt and thus the debt weight. Conversely, falling rates increase debt value.
  2. Stock Market Performance: As equity value (market capitalization) is highly volatile, changes in stock prices can significantly alter the equity weight. A booming stock market increases equity value, reducing the debt weight proportionally, while a market downturn has the opposite effect. This is why using current market values is critical.
  3. Company Performance and Growth Prospects: A company's perceived future profitability and growth opportunities influence its equity valuation. Stronger prospects tend to increase share prices and thus equity value, lowering the debt weight. Poor performance can reduce equity value, increasing the debt weight.
  4. Capital Structure Decisions: Management's strategic choices, such as issuing new debt to fund operations or share buybacks, or issuing new equity to reduce leverage, directly change the amounts of debt and equity, thereby altering the debt weight.
  5. Credit Rating Changes: A change in a company's credit rating affects the perceived riskiness of its debt. A downgrade might decrease the market value of its debt (as investors demand higher yields), lowering the debt weight. An upgrade could have the opposite effect.
  6. Inflationary Environment: While not a direct input, inflation can indirectly affect debt weight. High inflation often leads to higher interest rates, which can decrease the market value of existing debt. It also impacts company profitability and growth expectations, influencing equity values.
  7. Leverage Ratios and Covenants: Existing debt agreements often contain covenants that restrict the company's leverage ratios. If a company approaches a covenant limit, it might be forced to reduce debt or issue equity, directly impacting the debt weight calculation.

Frequently Asked Questions (FAQ)

What is the difference between debt weight and the cost of debt?
The debt weight represents the *proportion* of a company's capital structure financed by debt (e.g., 30%). The cost of debt is the *interest rate* a company pays on its borrowings. Both are essential for WACC, but they measure different things. The debt weight tells you how much influence the cost of debt has on the overall WACC.
Should I use book value or market value for debt and equity?
You should always use market values for calculating debt weight and WACC. Market values reflect the current economic conditions and investor expectations, making them more relevant for determining the current cost of capital. Book values represent historical costs and may not accurately represent the true cost or value of financing.
Can debt weight be 100%?
Theoretically, a company could have a debt weight of 100% if it is entirely financed by debt and has no equity. However, this is extremely rare and highly risky. Most companies maintain a mix of debt and equity to balance risk and return, and lenders often require a certain level of equity backing.
Can debt weight be 0%?
Yes, a debt weight of 0% means the company is financed entirely by equity. This is common for startups or companies that choose a very conservative financial strategy. In such cases, the WACC calculation simplifies to just the cost of equity.
How does a company's industry affect its debt weight?
Different industries have varying risk profiles and capital intensity. Stable, mature industries (like utilities) can often support higher debt weights due to predictable cash flows. Growth industries or highly cyclical industries tend to have lower debt weights because their cash flows are less stable, making higher leverage riskier.
What is the optimal debt weight?
There isn't a single "optimal" debt weight that applies to all companies. The optimal capital structure is the mix of debt and equity that minimizes the company's WACC, thereby maximizing firm value. This balance depends heavily on the company's specific industry, risk tolerance, growth stage, and market conditions. Finding this point often involves trade-offs between the benefits of debt (tax shield, potential for higher equity returns) and its risks (financial distress, bankruptcy).
How frequently should debt weight be recalculated?
Debt weight should be recalculated whenever there are significant changes in the market values of debt or equity, or at least annually as part of a regular financial review. For publicly traded companies, daily fluctuations in stock prices mean the equity weight can change constantly. Key strategic events like debt issuance, equity offerings, or major acquisitions also necessitate recalculation.
Does the tax rate affect the debt weight itself?
No, the tax rate does not directly affect the calculation of the debt weight. The debt weight is purely a ratio of the market values of debt and equity. However, the tax rate is critically important for the *overall WACC calculation* because it determines the benefit of the debt tax shield, effectively reducing the company's cost of debt.

Related Tools and Internal Resources

Capital Structure Breakdown

Visual representation of your company's debt and equity weights.

Debt Weight for WACC Calculation: A Summary

The debt weight for WACC calculation is a fundamental metric quantifying the proportion of a company's financing derived from debt. It serves as a critical input for calculating the Weighted Average Cost of Capital (WACC), which is essential for investment appraisal and firm valuation. Our calculator simplifies this process, allowing users to input total debt and equity values to instantly derive the debt weight and equity weight. Understanding this ratio helps assess financial risk, leverage, and the overall cost structure of a company. By considering market values and the impact of corporate tax rates (for WACC), businesses can make more informed strategic financial decisions.

© 2023 Your Financial Tools. All rights reserved.

var totalDebtInput = document.getElementById('totalDebt'); var totalEquityInput = document.getElementById('totalEquity'); var taxRateInput = document.getElementById('taxRate'); var resultsContainer = document.getElementById('resultsContainer'); var debtWeightResult = document.getElementById('debtWeightResult'); var equityWeightResult = document.getElementById('equityWeightResult'); var afterTaxDebtWeightResult = document.getElementById('afterTaxDebtWeightResult'); var mainResult = document.getElementById('mainResult'); var totalDebtError = document.getElementById('totalDebtError'); var totalEquityError = document.getElementById('totalEquityError'); var taxRateError = document.getElementById('taxRateError'); var chart = null; var chartContext = null; function validateInput(inputElement, errorElement, minValue, maxValue) { var value = parseFloat(inputElement.value); var errorMsg = ""; if (isNaN(value)) { errorMsg = "Please enter a valid number."; inputElement.style.borderColor = '#dc3545'; } else { if (value maxValue) { errorMsg = "Value is too high."; inputElement.style.borderColor = '#dc3545'; } else { inputElement.style.borderColor = '#ced4da'; // Default border color } } if (errorElement) { errorElement.textContent = errorMsg; } return errorMsg === ""; } function calculateWACC() { var isValidDebt = validateInput(totalDebtInput, totalDebtError, 0); var isValidEquity = validateInput(totalEquityInput, totalEquityError, 0); var isValidTaxRate = validateInput(taxRateInput, taxRateError, 0, 100); if (!isValidDebt || !isValidEquity || !isValidTaxRate) { resultsContainer.style.display = 'none'; return; } var totalDebt = parseFloat(totalDebtInput.value); var totalEquity = parseFloat(totalEquityInput.value); var taxRate = parseFloat(taxRateInput.value) / 100; // Convert percentage to decimal var totalCapital = totalDebt + totalEquity; var debtWeight = (totalCapital === 0) ? 0 : (totalDebt / totalCapital); var equityWeight = (totalCapital === 0) ? 0 : (totalEquity / totalCapital); // For the scope of THIS calculator, we only show debt weight & equity weight. // The after-tax cost of debt weight is illustrative for a full WACC calc. // To make it functional, we'd need Cost of Debt and Cost of Equity inputs. // For now, we'll display it as Debt Weight * Placeholder (e.g., 5%) // Placeholder cost of debt (assuming 5% pre-tax for illustration) var placeholderPreTaxCostOfDebt = 0.05; var afterTaxCostOfDebt = placeholderPreTaxCostOfDebt * (1 – taxRate); var afterTaxDebtWeight = debtWeight * afterTaxCostOfDebt; debtWeightResult.textContent = (debtWeight * 100).toFixed(2) + "%"; equityWeightResult.textContent = (equityWeight * 100).toFixed(2) + "%"; afterTaxDebtWeightResult.textContent = (afterTaxDebtWeight * 100).toFixed(2) + "%"; mainResult.textContent = (debtWeight * 100).toFixed(2) + "%"; resultsContainer.style.display = 'block'; updateChart(debtWeight, equityWeight); } function resetForm() { totalDebtInput.value = "50000000"; totalEquityInput.value = "100000000"; taxRateInput.value = "21"; totalDebtError.textContent = ""; totalEquityError.textContent = ""; taxRateError.textContent = ""; totalDebtInput.style.borderColor = '#ced4da'; totalEquityInput.style.borderColor = '#ced4da'; taxRateInput.style.borderColor = '#ced4da'; resultsContainer.style.display = 'none'; if (chart) { chart.destroy(); chart = null; } } function copyResults() { var debtWeight = debtWeightResult.textContent; var equityWeight = equityWeightResult.textContent; var taxCostDebtWeight = afterTaxDebtWeightResult.textContent; var totalDebt = totalDebtInput.value; var totalEquity = totalEquityInput.value; var taxRate = taxRateInput.value; var resultText = "— Debt Weight Calculation Results —\n\n"; resultText += "Key Assumptions:\n"; resultText += "- Total Debt Value: " + totalDebt + "\n"; resultText += "- Total Equity Value: " + totalEquity + "\n"; resultText += "- Corporate Tax Rate: " + taxRate + "%\n\n"; resultText += "Calculated Weights:\n"; resultText += "- Debt Weight: " + debtWeight + "\n"; resultText += "- Equity Weight: " + equityWeight + "\n"; resultText += "- After-Tax Cost of Debt Weight (Illustrative): " + taxCostDebtWeight + "\n\n"; resultText += "Main Result (Debt Weight): " + debtWeight + "\n"; resultText += "\n— End of Results —"; var textArea = document.createElement("textarea"); textArea.value = resultText; document.body.appendChild(textArea); textArea.select(); try { document.execCommand("copy"); alert("Results copied to clipboard!"); } catch (e) { alert("Failed to copy results. Please copy manually."); } textArea.remove(); } function initChart() { chartContext = document.getElementById('capitalStructureChart').getContext('2d'); updateChart(0, 0); // Initialize with placeholder values } function updateChart(debtWeight, equityWeight) { if (!chartContext) { initChart(); if (!chartContext) return; // If canvas element is not found } if (chart) { chart.destroy(); } var data = { labels: ["Debt", "Equity"], datasets: [{ label: 'Capital Structure', data: [debtWeight * 100, equityWeight * 100], // percentages backgroundColor: [ 'rgba(0, 74, 153, 0.7)', // Primary color for Debt 'rgba(40, 167, 69, 0.7)' // Success color for Equity ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(40, 167, 69, 1)' ], borderWidth: 1 }] }; var options = { responsive: true, maintainAspectRatio: true, // Allows control via canvas size plugins: { legend: { position: 'top', }, title: { display: true, text: 'Debt vs. Equity Weight Distribution', font: { size: 16 } } }, tooltips: { // for older Chart.js versions callbacks: { label: function(tooltipItem) { return tooltipItem.label + ": " + tooltipItem.raw.toFixed(2) + "%"; } } }, hover: { // for newer Chart.js versions mode: 'index', intersect: false }, interaction: { // for newer Chart.js versions mode: 'nearest', axis: 'x', intersect: false }, scales: { // Not typically needed for pie/doughnut charts, but good practice y: { beginAtZero: true } } }; chart = new Chart(chartContext, { type: 'doughnut', // Use doughnut for a circular representation data: data, options: options }); } function toggleFaq(element) { var answer = element.nextElementSibling; var isHidden = answer.style.display === "none" || answer.style.display === ""; // Close all other FAQs first var allAnswers = document.querySelectorAll('.faq-answer'); allAnswers.forEach(function(ans) { ans.style.display = 'none'; ans.previousElementSibling.querySelector('.faq-question').style.fontWeight = 'bold'; }); if (isHidden) { answer.style.display = "block"; element.style.fontWeight = 'bold'; // Keep clicked one bold } else { element.style.fontWeight = 'normal'; // Revert to normal if closing } } // Initial setup and event listeners document.addEventListener('DOMContentLoaded', function() { // Set default values on load totalDebtInput.value = "50000000"; totalEquityInput.value = "100000000"; taxRateInput.value = "21"; // Add input event listeners for real-time validation and calculation totalDebtInput.addEventListener('input', calculateWACC); totalEquityInput.addEventListener('input', calculateWACC); taxRateInput.addEventListener('input', calculateWACC); // Initial chart rendering initChart(); calculateWACC(); // Trigger calculation and chart update on page load });

Leave a Comment