How to Calculate Weighted Average of Common Shares Outstanding

How to Calculate Weighted Average of Common Shares Outstanding :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –secondary-text-color: #666; –border-color: #ddd; –shadow-color: rgba(0, 0, 0, 0.08); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); margin: 0; padding: 0; line-height: 1.6; } .container { max-width: 1000px; margin: 20px auto; padding: 20px; background-color: #fff; border-radius: 8px; box-shadow: 0 2px 10px var(–shadow-color); } header { background-color: var(–primary-color); color: #fff; padding: 20px 0; text-align: center; margin-bottom: 30px; border-radius: 8px 8px 0 0; } header h1 { margin: 0; font-size: 2.2em; font-weight: 600; } h2, h3 { color: var(–primary-color); margin-top: 1.5em; margin-bottom: 0.5em; } h2 { font-size: 1.8em; border-bottom: 2px solid var(–primary-color); padding-bottom: 5px; } h3 { font-size: 1.4em; } .calculator-section { margin-bottom: 40px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: #fdfdfd; } .calculator-section h2 { margin-top: 0; border-bottom: none; } .input-group { margin-bottom: 20px; } .input-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(–primary-color); } .input-group input[type="number"], .input-group select { width: calc(100% – 22px); padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; box-sizing: border-box; font-size: 1em; } .input-group input[type="number"]:focus, .input-group select:focus { outline: none; border-color: var(–primary-color); box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: var(–secondary-text-color); margin-top: 5px; } .input-group .error-message { font-size: 0.85em; color: #dc3545; margin-top: 5px; display: none; /* Hidden by default */ } .input-group .error-message.visible { display: block; } .button-group { text-align: center; margin-top: 25px; display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; } button { padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: 500; transition: background-color 0.3s ease, transform 0.2s ease; } button.primary { background-color: var(–primary-color); color: #fff; } button.primary:hover { background-color: #003366; transform: translateY(-1px); } button.secondary { background-color: #6c757d; color: #fff; } button.secondary:hover { background-color: #5a6268; transform: translateY(-1px); } button.tertiary { background-color: #28a745; color: #fff; } button.tertiary:hover { background-color: #218838; transform: translateY(-1px); } #results-container { margin-top: 30px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–background-color); } #results-container h3 { margin-top: 0; color: var(–primary-color); text-align: center; border-bottom: 1px solid var(–primary-color); padding-bottom: 8px; } .result-item { margin-bottom: 15px; font-size: 1.1em; color: var(–text-color); } .result-item span { font-weight: 600; color: var(–primary-color); } .primary-result { font-size: 1.8em; font-weight: 700; color: var(–primary-color); background-color: #e7f3ff; padding: 15px; border-radius: 6px; text-align: center; margin-bottom: 20px; border: 1px dashed var(–primary-color); } .formula-explanation { font-size: 0.95em; color: var(–secondary-text-color); margin-top: 20px; padding: 10px; background-color: #f0f0f0; border-left: 3px solid var(–primary-color); } table { width: 100%; border-collapse: collapse; margin-top: 20px; box-shadow: 0 1px 5px var(–shadow-color); } th, td { padding: 12px 15px; text-align: left; border: 1px solid var(–border-color); } thead { background-color: var(–primary-color); color: #fff; } th { font-weight: 600; } tbody tr:nth-child(even) { background-color: #f9f9f9; } tbody tr:hover { background-color: #eef2f7; } caption { font-size: 1.1em; font-weight: 600; color: var(–primary-color); margin-bottom: 10px; caption-side: top; text-align: left; } canvas { display: block; margin: 20px auto; max-width: 100%; border: 1px solid var(–border-color); border-radius: 5px; } .chart-legend { text-align: center; margin-top: 10px; font-size: 0.9em; color: var(–secondary-text-color); } .chart-legend span { display: inline-block; margin: 0 10px; } .chart-legend .color-box { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: middle; } .internal-links-section { margin-top: 40px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: #fdfdfd; } .internal-links-section ul { list-style: none; padding: 0; } .internal-links-section li { margin-bottom: 15px; } .internal-links-section a { color: var(–primary-color); text-decoration: none; font-weight: 500; } .internal-links-section a:hover { text-decoration: underline; } .internal-links-section p { font-size: 0.9em; color: var(–secondary-text-color); margin-top: 5px; } footer { text-align: center; margin-top: 40px; padding: 20px; font-size: 0.9em; color: var(–secondary-text-color); } @media (max-width: 768px) { .container { margin: 10px; padding: 15px; } header h1 { font-size: 1.8em; } button { width: 100%; margin-bottom: 10px; } .button-group { flex-direction: column; align-items: center; } }

How to Calculate Weighted Average of Common Shares Outstanding

Weighted Average Shares Outstanding Calculator

Calculate the weighted average number of common shares outstanding for financial reporting periods, crucial for accurate EPS calculations.

Enter the total number of common shares outstanding at the start of the reporting period.
Enter the total number of common shares outstanding at the end of the reporting period.
Enter the net change in shares outstanding during the period (new issuances minus repurchases).
Enter the duration of the reporting period in months (e.g., 3 for a quarter, 12 for a year).

Calculation Results

N/A
Weighted Shares at Period Start: N/A
Weighted Shares Issued Mid-Period: N/A
Weighted Shares at Period End: N/A
Formula Used: Weighted Average Shares Outstanding = (Shares at Start * Weight) + (Shares Issued Mid-Period * Weight) + (Shares at End * Weight)
In simpler terms, we adjust the number of shares outstanding by the portion of the period they were actually outstanding.

Shares Outstanding Trend

Shares at Start Shares Issued Shares at End

Period Share Data

Metric Value Weight
Shares at Start of Period N/A N/A
Shares Issued Net During Period N/A N/A
Shares at End of Period N/A N/A

What is Weighted Average of Common Shares Outstanding?

The **weighted average of common shares outstanding** is a fundamental financial metric used in corporate finance and accounting. It represents the average number of a company's common shares that have been issued and are held by shareholders over a specific reporting period, taking into account any changes like stock issuances or repurchases throughout that period. This metric is absolutely critical for calculating a company's Earnings Per Share (EPS), a key profitability indicator that investors closely scrutinize. Understanding how to calculate weighted average of common shares outstanding ensures that EPS figures accurately reflect the diluted ownership structure over time, preventing potentially misleading earnings figures.

Who Should Use It?

Several groups heavily rely on the **weighted average of common shares outstanding**:

  • Financial Analysts: To accurately assess a company's profitability on a per-share basis and compare it against industry peers.
  • Investors: To understand the true earnings power of their investment and to evaluate the potential dilution from future share issuances.
  • Company Management: For internal performance reporting, strategic decision-making regarding share buybacks or new equity offerings, and for compliance with accounting standards.
  • Accountants and Auditors: To ensure financial statements, particularly the calculation of EPS, are prepared in accordance with Generally Accepted Accounting Principles (GAAP) or International Financial Reporting Standards (IFRS).

Common Misconceptions

A common misconception is that one can simply average the shares outstanding at the beginning and end of the period. This is incorrect because it doesn't account for the timing of share changes. For example, if a company issues a large number of shares on the very last day of the period, simply averaging the start and end numbers would overstate the shares outstanding for most of the period. The "weighted" aspect correctly applies a fraction of the period for which shares were outstanding. Another misconception is that it only applies to public companies; private companies may also use this calculation for internal valuations or when seeking investment.

Weighted Average of Common Shares Outstanding: Formula and Mathematical Explanation

The core idea behind calculating the **weighted average of common shares outstanding** is to give a pro-rata weight to shares based on how long they were outstanding during the reporting period. This ensures that changes in share counts are reflected accurately over the entire period, not just at the beginning or end.

The Formula Derivation

The general formula accounts for shares issued at the beginning of the period and any net changes (issuances minus repurchases) that occur during the period. Let's break it down:

1. Shares Outstanding at the Beginning of the Period: These shares were outstanding for the entire reporting period. Their weight is 1 (or 100%).

2. Shares Issued (or Repurchased) During the Period: These shares were not outstanding for the full period. They need to be weighted by the fraction of the period they were outstanding.

3. Shares Outstanding at the End of the Period: This is the final count after all transactions.

The most common and precise method considers the timing of each issuance or repurchase.

Simplified Formula for calculation when changes occur mid-period:

Weighted Average Shares = (Shares at Start × Weight of Start Shares) + (Shares Added/Removed Mid-Period × Weight of Added/Removed Shares)

Where:

  • Weight of Start Shares = 1 (or the full period duration, if considering sub-periods)
  • Weight of Added/Removed Shares = Fraction of the period the shares were outstanding (e.g., if a period is 12 months and shares were issued 3 months before the end, they were outstanding for 3/12 = 0.25 of the period).

A more practical approach often used involves breaking the period into sub-periods based on when share counts changed:

Detailed Formula:

Weighted Average Shares = Σ (Number of Shares in Period × Fraction of Period Outstanding)

This formula sums the product of the number of shares outstanding in each sub-period multiplied by the fraction of the reporting period those shares were outstanding.

Variable Explanations

Let's define the key variables you'll encounter when calculating the **weighted average of common shares outstanding**:

Variables for Weighted Average Shares Outstanding Calculation
Variable Meaning Unit Typical Range
Shares at Start Number of common shares outstanding at the beginning of the reporting period. Shares ≥ 0
Shares at End Number of common shares outstanding at the end of the reporting period. Shares ≥ 0
Shares Issued (Net) The net increase or decrease in shares outstanding during the period due to issuances (e.g., IPO, secondary offering, stock options exercised) and repurchases (buybacks). Shares Can be positive (net issuance) or negative (net repurchase)
Period Length The total duration of the financial reporting period (e.g., 3 months for a quarter, 12 months for a year). Months or Days Typically 1, 3, 6, or 12 months for interim/annual reports.
Date of Share Change The specific date when shares were issued or repurchased. Crucial for determining the weight. Date Any date within the reporting period.
Weight The fraction of the reporting period that a specific block of shares was outstanding. Decimal (0 to 1) 0 to 1
Weighted Average Shares The final calculated average number of shares outstanding over the period. Shares ≥ 0

Practical Examples (Real-World Use Cases)

Example 1: Simple Issuance During a Quarter

Company A has the following share data for the quarter ended March 31 (a 3-month period):

  • Shares Outstanding on January 1: 100,000 shares
  • Shares Issued on February 1: 20,000 shares (net issuance)
  • Shares Outstanding on March 31: 120,000 shares
  • Reporting Period Length: 3 months

Calculation:

The shares issued on Feb 1 were outstanding for 2 months (February and March).

Weight for beginning shares = 3 months / 3 months = 1.0

Weight for shares issued mid-period = 2 months / 3 months = 0.667

Weighted Average Shares = (100,000 shares * 1.0) + (20,000 shares * 0.667)

Weighted Average Shares = 100,000 + 13,340

Weighted Average Shares Outstanding = 113,340 shares

Financial Interpretation: Using the simple average (100,000 + 120,000) / 2 = 110,000 would be inaccurate. The weighted average of 113,340 better reflects the fact that the additional 20,000 shares were outstanding for 2/3rds of the quarter.

Example 2: Issuance and Repurchase During a Year

Company B has the following share data for the year ended December 31 (a 12-month period):

  • Shares Outstanding on January 1: 500,000 shares
  • Shares Repurchased on April 1: 50,000 shares (net reduction)
  • Shares Issued on October 1: 100,000 shares (net issuance)
  • Shares Outstanding on December 31: 550,000 shares
  • Reporting Period Length: 12 months

Calculation Breakdown by Sub-Period:

  • Period 1 (Jan 1 – Mar 31): 500,000 shares outstanding for 3 months. Weight = 3/12 = 0.25. Contribution = 500,000 * 0.25 = 125,000
  • Period 2 (Apr 1 – Sep 30): 450,000 shares outstanding (500,000 – 50,000) for 6 months. Weight = 6/12 = 0.50. Contribution = 450,000 * 0.50 = 225,000
  • Period 3 (Oct 1 – Dec 31): 550,000 shares outstanding (450,000 + 100,000) for 3 months. Weight = 3/12 = 0.25. Contribution = 550,000 * 0.25 = 137,500

Weighted Average Shares = 125,000 + 225,000 + 137,500

Weighted Average Shares Outstanding = 487,500 shares

Financial Interpretation: The simple average of start (500,000) and end (550,000) shares is 525,000. However, the company had fewer shares outstanding for the bulk of the year due to the April repurchase, followed by an increase in October. The calculated weighted average of 487,500 accurately reflects these fluctuations, leading to a more precise EPS calculation.

How to Use This Weighted Average Shares Outstanding Calculator

Our calculator simplifies the process of determining the **weighted average of common shares outstanding**. Follow these steps:

  1. Enter Shares at Beginning of Period: Input the total number of common shares outstanding at the very start of your reporting period (e.g., January 1st for a quarterly report).
  2. Enter Shares at End of Period: Input the total number of common shares outstanding at the very end of your reporting period (e.g., March 31st for a quarterly report).
  3. Enter Shares Issued (Net) During Period: This is crucial. Enter the *net* effect of all share transactions during the period. If more shares were issued than repurchased, this is a positive number. If more shares were repurchased than issued, enter a negative number. The calculator will automatically determine the timing if you input the net change and the period length. (Note: The calculator simplifies this by assuming net change occurs evenly, or you can use more complex methods if you know exact dates.)
  4. Enter Reporting Period Length (Months): Specify the duration of the reporting period in months (e.g., 3 for Q1, 12 for a full year).
  5. Click 'Calculate': The calculator will instantly display the weighted average number of common shares outstanding.

How to Read Results

  • Primary Result (Weighted Average Shares Outstanding): This is your main figure. It represents the average number of shares active throughout the entire reporting period.
  • Intermediate Weighted Values: These show the adjusted contribution of shares from the start, mid-period changes, and end, reflecting their respective weights.
  • Table Data: Provides a clear breakdown of the input values and their calculated weights.
  • Chart: Visually represents the share count fluctuations across the period.

Decision-Making Guidance

The **weighted average of common shares outstanding** directly impacts your Earnings Per Share (EPS) calculation. A higher weighted average shares outstanding will result in a lower EPS (all else being equal), while a lower average will result in a higher EPS. Management might use this metric to evaluate the impact of share buyback programs (which aim to reduce the weighted average and increase EPS) versus new stock issuances (which increase the weighted average and dilute EPS). Accurate calculation is vital for investor relations and financial analysis.

Key Factors That Affect Weighted Average of Common Shares Outstanding Results

Several factors influence the calculation and the resulting **weighted average of common shares outstanding**:

  1. Share Issuances: When a company issues new shares (e.g., through an Initial Public Offering (IPO), secondary offerings, or employee stock options being exercised), the number of shares outstanding increases. If these occur mid-period, they reduce the overall weight for the period prior to issuance, but increase the number of shares for the remainder of the period.
  2. Share Repurchases (Buybacks): When a company buys back its own shares from the market, the number of shares outstanding decreases. These repurchases reduce the weighted average, particularly if they happen earlier in the reporting period.
  3. Stock Splits and Reverse Splits: A stock split increases the number of shares outstanding but also adjusts the historical share counts proportionally. A reverse stock split does the opposite. These events require restating prior period shares to maintain comparability. For example, a 2-for-1 stock split means you double the shares outstanding for the current and all prior periods presented.
  4. Convertible Securities and Options: While not directly part of the basic calculation, the potential issuance of shares from convertible bonds, preferred stock, or stock options (which are dilutive) is considered when calculating *Diluted EPS*, which uses a more complex weighted average calculation.
  5. Reporting Period Length: The duration of the period (quarterly, annually) directly affects the weights assigned. Shares outstanding for a shorter portion of a longer period will have a lower weight.
  6. Timing of Transactions: As highlighted in the examples, the exact date of any share issuance or repurchase is critical. Shares are only weighted for the portion of the period they were actually outstanding. This is why meticulous record-keeping is essential.
  7. Accounting Standards (GAAP/IFRS): These standards dictate precisely how to calculate weighted average shares, especially concerning complex securities and restatements, ensuring consistency and comparability across financial reports.

Frequently Asked Questions (FAQ)

Q1: What is the difference between basic and diluted EPS?

Basic EPS uses the simple weighted average of common shares outstanding. Diluted EPS considers the potential dilution from convertible securities, options, and warrants, effectively using a weighted average that assumes these potentially dilutive instruments are exercised.

Q2: Do I need to adjust for stock splits in prior periods?

Yes, when reporting comparative financial statements, you must retroactively adjust the weighted average shares outstanding for all prior periods presented to reflect the stock split as if it occurred at the beginning of the earliest period presented.

Q3: What if shares were issued on the first day of the period?

If shares were issued on the first day, they are considered outstanding for the entire period. Their weight is 1.0 (or 100%).

Q4: What if shares were repurchased on the last day of the period?

If shares were repurchased on the last day, they are considered outstanding for the entire period. The weighted average calculation will reflect the higher number of shares for the full period.

Q5: How do I handle multiple issuances and repurchases within a single period?

You must break the period into sub-periods. Each sub-period starts when a change in share count occurs and ends when the next change occurs or the period ends. Calculate the weighted average for each sub-period and sum their contributions. Our calculator simplifies this by assuming a single net change, but for precise calculations with multiple events, manual breakdown is needed.

Q6: Can the weighted average shares outstanding be higher than the shares at the end of the period?

No, generally not, unless there were significant historical adjustments or errors. The weighted average typically falls between the lowest and highest share counts during the period, adjusted for timing. In cases of very early net issuances, it might slightly exceed the end-of-period count if the initial count was much lower and remained low for most of the year.

Q7: Does the calculation include preferred shares?

No, the 'weighted average of common shares outstanding' specifically refers to common stock. Preferred shares are treated differently in EPS calculations.

Q8: Why is this calculation important for investors?

It helps investors understand how much of the company's earnings is attributable to each common share. A lower weighted average often signals that a company is actively managing its share count, potentially boosting EPS and shareholder value.

© 2023 Financial Calculators Inc. All rights reserved.

var chartInstance = null; function getInputValue(id) { var input = document.getElementById(id); if (input) { var value = parseFloat(input.value); return isNaN(value) ? null : value; } return null; } function setErrorMessage(id, message) { var errorElement = document.getElementById(id); if (errorElement) { if (message) { errorElement.innerText = message; errorElement.classList.add('visible'); } else { errorElement.innerText = "; errorElement.classList.remove('visible'); } } } function validateInputs() { var sharesIssued = getInputValue('sharesIssued'); var sharesIssuedEnd = getInputValue('sharesIssuedEnd'); var sharesIssuedNew = getInputValue('sharesIssuedNew'); var periodLength = getInputValue('periodLength'); var isValid = true; if (sharesIssued === null || sharesIssued < 0) { setErrorMessage('sharesIssuedError', 'Please enter a valid number for shares at the start.'); isValid = false; } else { setErrorMessage('sharesIssuedError', ''); } if (sharesIssuedEnd === null || sharesIssuedEnd < 0) { setErrorMessage('sharesIssuedEndError', 'Please enter a valid number for shares at the end.'); isValid = false; } else { setErrorMessage('sharesIssuedEndError', ''); } if (sharesIssuedNew === null) { setErrorMessage('sharesIssuedNewError', 'Please enter a valid number for net shares issued.'); isValid = false; } else { setErrorMessage('sharesIssuedNewError', ''); } if (periodLength === null || periodLength 0.01) { // Allow for minor floating point diffs if calculation is complex console.warn("Warning: Shares at end (" + sharesIssuedEnd + ") does not exactly match Shares at Start (" + sharesIssued + ") + Net Issued (" + sharesIssuedNew + "). Calculation uses provided start and net issued values."); } // Update intermediate results for display document.getElementById('weightedStartShares').innerText = weightedStartShares.toLocaleString(undefined, { maximumFractionDigits: 0 }); document.getElementById('weightedIssuedShares').innerText = weightedIssuedShares.toLocaleString(undefined, { maximumFractionDigits: 0 }); document.getElementById('weightedEndShares').innerText = sharesIssuedEnd.toLocaleString(undefined, { maximumFractionDigits: 0 }); // Display actual end shares // Display the primary result var mainResultElement = document.getElementById('main-result'); mainResultElement.innerText = weightedAverageShares.toLocaleString(undefined, { maximumFractionDigits: 0 }); // Update Table document.getElementById('tableSharesStart').innerText = sharesIssued.toLocaleString(undefined, { maximumFractionDigits: 0 }); document.getElementById('tableSharesIssued').innerText = sharesIssuedNew.toLocaleString(undefined, { maximumFractionDigits: 0 }); document.getElementById('tableSharesEnd').innerText = sharesIssuedEnd.toLocaleString(undefined, { maximumFractionDigits: 0 }); document.getElementById('weightStart').innerText = (weightStart * 100).toFixed(1) + '%'; document.getElementById('weightIssued').innerText = (weightIssued * 100).toFixed(1) + '%'; document.getElementById('weightEnd').innerText = 'N/A'; // Weight end isn't a separate factor in this simplified sum updateChart(sharesIssued, sharesIssuedNew, sharesIssuedEnd, periodLength); } function resetForm() { document.getElementById('sharesIssued').value = '100000'; document.getElementById('sharesIssuedEnd').value = '120000'; document.getElementById('sharesIssuedNew').value = '20000'; document.getElementById('periodLength').value = '12'; document.getElementById('main-result').innerText = 'N/A'; document.getElementById('weightedStartShares').innerText = 'N/A'; document.getElementById('weightedIssuedShares').innerText = 'N/A'; document.getElementById('weightedEndShares').innerText = 'N/A'; // Clear error messages setErrorMessage('sharesIssuedError', "); setErrorMessage('sharesIssuedEndError', "); setErrorMessage('sharesIssuedNewError', "); setErrorMessage('periodLengthError', "); // Clear table data document.getElementById('tableSharesStart').innerText = 'N/A'; document.getElementById('tableSharesIssued').innerText = 'N/A'; document.getElementById('tableSharesEnd').innerText = 'N/A'; document.getElementById('weightStart').innerText = 'N/A'; document.getElementById('weightIssued').innerText = 'N/A'; document.getElementById('weightEnd').innerText = 'N/A'; // Clear chart if (chartInstance) { chartInstance.destroy(); chartInstance = null; } var canvas = document.getElementById('sharesChart'); var ctx = canvas.getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height); } function copyResults() { var mainResult = document.getElementById('main-result').innerText; var weightedStart = document.getElementById('weightedStartShares').innerText; var weightedIssued = document.getElementById('weightedIssuedShares').innerText; var weightedEnd = document.getElementById('weightedEndShares').innerText; var sharesIssuedInput = document.getElementById('sharesIssued').value; var sharesIssuedEndInput = document.getElementById('sharesIssuedEnd').value; var sharesIssuedNewInput = document.getElementById('sharesIssuedNew').value; var periodLengthInput = document.getElementById('periodLength').value; var copyText = "Weighted Average Shares Outstanding Calculation:\n\n"; copyText += "— Results —\n"; copyText += "Weighted Average Shares Outstanding: " + mainResult + "\n"; copyText += "Weighted Shares at Period Start: " + weightedStart + "\n"; copyText += "Weighted Shares Issued Mid-Period: " + weightedIssued + "\n"; copyText += "Shares at Period End: " + weightedEnd + "\n\n"; copyText += "— Key Assumptions —\n"; copyText += "Shares at Start: " + sharesIssuedInput + "\n"; copyText += "Shares Issued (Net) During Period: " + sharesIssuedNewInput + "\n"; copyText += "Reporting Period Length: " + periodLengthInput + " months\n"; var textArea = document.createElement("textarea"); textArea.value = copyText; document.body.appendChild(textArea); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied!' : 'Copy failed'; console.log(msg); // Optionally show a temporary message to the user var tempMsg = document.createElement('div'); tempMsg.innerText = msg; tempMsg.style.position = 'fixed'; tempMsg.style.bottom = '10px'; tempMsg.style.left = '50%'; tempMsg.style.transform = 'translateX(-50%)'; tempMsg.style.backgroundColor = '#004a99'; tempMsg.style.color = 'white'; tempMsg.style.padding = '10px'; tempMsg.style.borderRadius = '5px'; document.body.appendChild(tempMsg); setTimeout(function(){ document.body.removeChild(tempMsg); }, 2000); } catch (err) { console.log('Oops, unable to copy'); } document.body.removeChild(textArea); } function updateChart(sharesStart, sharesNetIssued, sharesEnd, periodLength) { var canvas = document.getElementById('sharesChart'); var ctx = canvas.getContext('2d'); // Clear previous chart if it exists if (chartInstance) { chartInstance.destroy(); } var midPoint = periodLength / 2; var endPoint = periodLength; // Chart data points representing the shares outstanding at different points in time // We'll show: Start, Midpoint (after net issue/repurchase), End. var labels = ['Start (Month 0)', 'Mid-Period (Month ' + midPoint + ')', 'End (Month ' + endPoint + ')']; var dataStart = [sharesStart, sharesStart, sharesStart]; // Shares at start remain constant until a change var dataNetIssued = [sharesStart, sharesStart + sharesNetIssued, sharesStart + sharesNetIssued]; // This represents the count after the net change var dataEnd = [sharesStart + sharesNetIssued, sharesStart + sharesNetIssued, sharesEnd]; // Ensure end value is respected // Use the actual input values if they don't match calculation precisely var actualStart = getInputValue('sharesIssued'); var actualNetIssued = getInputValue('sharesIssuedNew'); var actualEnd = getInputValue('sharesIssuedEnd'); var calculatedMid = actualStart + (actualNetIssued * 0.5); // Based on calculation logic // Corrected data points for clarity: // Point 1: Beginning of Period // Point 2: After Net Change (assumed mid-period) // Point 3: End of Period var chartLabels = ['Start', 'Mid-Period', 'End']; var chartDataSeries1 = [actualStart, actualStart, actualStart]; // Baseline shares var chartDataSeries2 = [actualStart, calculatedMid, actualEnd]; // Reflects net change chartInstance = new Chart(ctx, { type: 'line', data: { labels: chartLabels, datasets: [{ label: 'Shares Outstanding', data: chartDataSeries2, // Represents the actual share count throughout the period borderColor: 'rgba(0, 74, 153, 0.7)', backgroundColor: 'rgba(0, 74, 153, 0.1)', tension: 0.1, fill: false }, { label: 'Baseline Shares (Start)', data: chartDataSeries1, // Constant line for starting shares borderColor: 'rgba(40, 167, 69, 0.5)', backgroundColor: 'rgba(40, 167, 69, 0.1)', tension: 0, fill: false, borderDash: [5, 5] }] }, options: { responsive: true, maintainAspectRatio: true, scales: { y: { beginAtZero: true, title: { display: true, text: 'Number of Shares' } }, x: { title: { display: true, text: 'Period Stage' } } }, plugins: { title: { display: true, text: 'Share Count Over the Reporting Period' }, legend: { display: false // Using custom legend below } } } }); } // Initial calculation on load if values are set window.onload = function() { calculateWeightedAverageShares(); };

Leave a Comment