The expected value formula involves multiplying the estimated dollar amount of each possible outcome by the estimated probability of that outcome adding up the result for every possibility. The results for each outcome have to include the ability to pay if you win and the cost of collecting if you win and the time value of money if not settling delays getting you paid.
This formula is routinely used in litigation to evaluate settlements, but it is only a starting point, it isn't the only factor that should be considered.
You need to consider the margin of error in the estimates. A big margin of error in the best or worst case scenario, or in a small probability, can make a huge difference. You also need to recognize that it is well known that the best lawyers who ultimately get the best results, routinely overestimate the strength of their own cases, and that clients usually overestimate the strength of their own cases as well. This is a well known cognitive bias and you need to correct for it.
You need to include reaching a settlement later on, but before trial, in your list of possibilities. Often, even if it make sense to settle, making an offer at just the right moment instead of a less opportune time can make a big difference. Similarly, you have to consider the case from the other side's point of view to get a realistic sense of what the other side might be willing to pay. If it seems very likely that they would be willing to pay more, you might not want to accept an offer even if the amount offered would be good enough to be an acceptable result for you.
You need to consider the future litigation costs that are avoided by settling, both in terms of dollars paid to lawyers and litigation costs, and in terms of lost time, expense and opportunity costs to you or your firm.
You need to consider the economic harm that you may suffer from not having the matter resolved now rather than later. For example, suppose that your firm is about to have a public offering of stock, and if the litigation is not settled, the litigation will have to be disclosed and will have a disproportionate negative effect on the price investors will be willing to pay in the public offering. It may pay to settle a case for "more than its worth" to avoid the economic harm caused by having the litigation still outstanding.
You need to consider the economic harm potentially caused by information disclosed in the context of a public trial which would reveal information that there is economic value in keeping secret, or that might encourage others to bring additional lawsuits.
You need to consider the long term strategic impact of each possible outcome when considering each possibility and in considering settlement, and not just the impact in the immediate transaction. Once something has been proven in court, that loss in one case can frequently be held to have been judicially established in future cases in many circumstances.
For example, if a contract term is determined to have a particular meaning in a lawsuit, and the court interprets it in an unfavorable way, that could influence the economic value of another 200,000 outstanding contracts with the same language where the meaning of this term has not been resolved in litigation, and it could open the door to a class action lawsuit against you on behalf of a class consisting of all 200,000 counter-parties with you on this contract. If it the contract interpretation makes only a $5 difference in each case, the incentive to prevent that from being resolved against you in court could be huge.
On the other hand, if a corporation that engaged in many transactions gets a reputation for easily settling weak cases for generous amounts, they will be bombarded with frivolous lawsuits.
Expected value really only makes sense with these adjustment and also only for repeat players in cases where the outcome of any particular case will not materially affect the person considering a settlement and there are no long term strategic effects, such as large employers and large companies in consumer cases that try to force other parties to resolve disputes with them on a case by case basis in confidential arbitration hearings that don't create precedents.
It is less useful for one time participants in the legal system in a case with life changing consequences, as the benefits and costs of an outcome may be non-economic or may be non-linear (although this can be solved by more accurately valuing the dollar amounts in an expected value formula to consider the total impact of a particular result rather than the naive immediate payment).
This non-linear factor is critical in these cases, however, because the personal utility value of an outcome is not strictly a matter of average dollar return. To give a simple and fairly common example, suppose that you have a case where you have a 70% chance of winning and a 30% chance of losing. If you lose you get nothing and pay nothing. If you win, you get $10,000,000. The expected value is $7,000,000. But, if you have someone who has never had real money in their life and will never have an opportunity to get real money in their life ever again, settling for a 100% chance of getting $3,000,000 could very well be better than getting a 70% chance of getting $10,000,000, because to that person the difference between getting $3,000,000 and $10,000,000 may not be very important, but the difference between getting at least $3,000,000 and getting $0 would be huge.
One of the reasons that plaintiffs like to use class action lawsuits is that handling one big all or nothing cases causes businesses to stop thinking like expected value repeat player robots, and to start thinking like individuals who participate in litigation one time with high stakes, causing them to accept less optimal settlements for them relative to expected value to avoid the risk of a big disaster. Paying settlements or losing a modest percentage of small cases now and then won't harm anyone's career. Losing a big life or death of the company case after going to trial when a settlement that was a better deal was an option will cost the entire management team their careers and get many of the lawyers at the firm handling the defense of the case fired as well.