Stock profit calculator guide

How Many Shares to Sell for a Profit Target

Work backward from an expected sell price and a target cash amount. The calculator can find an exact fractional quantity or a practical whole-share result while keeping proceeds, realized profit, and the remaining position visible.

Quick answer

How do you calculate the number of shares to sell?

Choose Find shares to sell, enter the expected Sell price per share, select Net proceeds, Net profit or loss, or Shares remaining, and enter the target. The result is the smallest eligible quantity that follows the selected fractional- or whole-share policy.

For a simple Net proceeds target with a flat fee and no dividend, divide the target plus the Sell commission by the Sell price per share.

Shares to sell=(Target net proceeds + Sell commission)/Sell price per share
Annotated stock profit calculator result showing 41.75 shares to sell for 5,000 dollars in net proceeds
The numbered arrows connect the solved share quantity with the net proceeds target and the realized profit at that share count.
  1. 1

    Shares to sell. The exact fractional-share result is 41.75 shares.

  2. 2

    Target reached. Selling that quantity at the entered price produces $5,000.00 in Net proceeds.

  3. 3

    Profit at that quantity. The same sale assigns proportional cost basis and produces $820.82 in realized profit.

Calculator walkthrough

Set the price, target, and share policy

Open the stock profit calculator and start with the value you already know: the expected selling price.

1. GOAL

Find shares to sell

Select the inverse workflow for a known sell price and target amount.

2. TARGET

Choose the outcome

Target Net proceeds, Net profit or loss, or the number of Shares remaining.

3. POLICY

Choose share precision

Use an exact fractional result, whole shares that meet the target, or the closest whole-share result.

4. ALLOCATION

Select the lots

For multiple purchases, use FIFO, LIFO, or explicit Specific-lot limits.

5. VERIFY

Read the sale plan

Check shares sold, proceeds, realized profit, shares left, and remaining cost basis together.

6. COMPARE

Review FIFO and LIFO

Compare both methods without rebuilding the position when more than one lot remains.

Worked proceeds example

Sell 41.75 shares for $5,000 in net proceeds

Assume an expected sell price of $120 per share, a $10 flat Sell commission, no dividend, and a $5,000 Net proceeds target.

The exact calculation is ($5,000 + $10) / $120 = 41.75 shares. Selling 41.75 shares produces $5,010 in Gross sale value and $5,000 in Net proceeds after the fee.

Exact and whole-share result

41.75 exact shares or 42 whole shares

A meet-target whole-share policy rounds up to 42 shares. That sale produces $5,030 in Net proceeds, which is $30 above the target.

Sell price
$120.00
Target net proceeds
$5,000.00
Exact shares
41.75
Meet-target whole shares
42
Whole-share proceeds
$5,030.00
Exact and whole-share policies for a $5,000 net-proceeds target
PolicyShares soldNet proceedsDifference from target
Exact fractional41.75$5,000.00$0.00
Whole shares: meet target42$5,030.00+$30.00
Whole shares: closest42$5,030.00+$30.00

Cost-basis-aware target

A profit target depends on the shares selected for sale

Net profit is not determined by sale proceeds alone. The calculator must also assign the correct purchase value and Buy commission to the shares being sold.

For one purchase of 100 shares at $100 with a $10 Buy commission, each share carries $100.10 of basis. At a $120 Sell price and a $10 flat Sell commission, the exact quantity for $1,000 of Net profit is ($1,000 + $10) / ($120 - $100.10) = 50.7538 shares. A meet-target whole-share result is 51 shares and produces $1,004.90 of profit.

With multiple lots, the contribution per additional share changes when one lot is exhausted. The solver therefore allocates shares in order instead of dividing the target by a single position-wide average.

One purchase

Each sold share receives the same proportional share of purchase value and Buy commission.

FIFO

The oldest remaining purchase entries supply shares first, so their basis drives the target calculation.

LIFO

The newest remaining purchase entries supply shares first and can produce a different realized profit.

Specific lots

The calculator follows the explicit per-lot limits and purchase order entered by the user; it does not infer a preferred tax lot.

How lot order changes shares needed for a $1,000 profit target
AllocationFirst lot usedExact shares neededWhy
FIFO50 shares at $8020.24Lower basis contributes about $49.90 per share after allocated fees
LIFO50 shares at $12060.32The first 50 shares contribute less profit before the solver reaches the $80 lot

For the underlying allocation rules, read FIFO vs LIFO Stock Sale Profit and the partial-sale guide.

Validation

When a shares-to-sell target cannot be reached

A useful solver must reject an impossible target instead of suggesting more shares than the position contains.

Not enough shares

The maximum eligible sale cannot produce the requested proceeds or profit at the entered price.

Specific-lot limit

The entered lot limits provide fewer eligible shares than the target requires.

Whole-share gap

A closest-result policy can miss the target because no whole number of shares reproduces an exact fractional answer.

Fee effect

A flat Sell commission has a larger proportional effect on a small sale, while a percentage fee scales with Gross sale value.

Methodology and references

Treat the result as a sale plan, not an execution promise

The calculator uses the price, fees, dividends, shares, and lots entered by the user. A modeled selling price does not guarantee an order will execute at that price.

Related calculator guides

Connect share quantity with price and realized profit

These guides explain the two inverse calculations and the lot-allocation rules used in the sale plan.

Ready to calculate how many shares to sell?

Use the Stock Profit Calculator