Bob Olsen, president of Peregrine Outfitters, a Vermont-based sporting-goods wholesaler, recently discovered he was losing money on two-thirds of the 6,000 products he sells. Ouch. But he also learned that by adjusting the terms under which the products were sold, he could lower some prices and still make a profit.

Olsen could have used that information a lot earlier. His 15-year-old company serves as the middleman between 600 manufacturers and 1,800 retail stores, including L.L. Bean. "We have the thinnest margins on the food chain," he says. But with just 38 employees, Olsen lacked the resources needed to analyze the myriad factors -- from shipping charges to order sizes -- that affect Peregrine's operating costs and determine those margins. Up until now, that is.

Peregrine is one of the early adopters of a new breed of profit-analyzing software that promises to transform the dark art of pricing into an exact science. The software, just now becoming available for small and midsize companies, isn't cheap. But it could prove indispensable -- especially for companies struggling to maintain margins at a time when revenue growth remains frustratingly elusive.

Kent Monroe, a marketing professor at the University of Illinois at Urbana-Champaign, says such applications are based on pricing concepts he's been teaching his students for years. Imagine you're a pharmacy owner trying to figure out how much to charge for a bottle of aspirin, Monroe says. Sales are steady at 99¢, but what if you could charge more? To find out, raise the price, say, 20¢, to $1.19, and observe whether or not customers continue buying the aspirin. If sales fall off, cut the price back down to what the market will bear. If they remain steady, keep pushing up the price.

Sounds simple enough. The problem is that most businesses lack the people or time to continually analyze all their products and customers. That's where the software, which has its roots in the yield-management strategies used in the airline industry, comes in. It uses intricate algorithms to analyze years of raw data (culled mostly from already existing company databases) to churn out a detailed analysis of the profitability of every level of the business. Business owners can then study the results and figure out how to adjust their operations accordingly.

Olsen, who installed pricing software by Houston-based Acorn Systems last March, learned that some customers were placing only very small orders of some lower-priced items. By the time his salespeople took the calls and located the products, he was already losing money. "It costs $30 to make a trip down the aisle," he says, "so why not get the order up to the $30 level?" He began offering customers a price break for ordering more products. Olsen also altered his approach to shipping. The company had long offered two-day delivery. By switching to three days, Olsen learned he could save enough to cut some prices without cutting into margins.

Mike Jarmusz, CEO of AP Wagner, an appliance parts distributor in Buffalo, N.Y., was similarly surprised by what he learned from Acorn's system. With 85% of his 175-person company's $35 million in revenue coming from its wholesale business, that had been management's main concern. But, after reviewing the profit-analysis results, Jarmusz realized that the company's smaller retail arm was much more profitable than he thought. So he poured more money into local Yellow Pages ads and beefed up the stock at its 20 branch locations to keep up with demand. Both wholesale and retail sales at those locations have since increased. "The software has changed our company culture," says Jarmusz. "Instead of just thinking about selling more, we're looking at the bottom line."

Such results don't come cheap. Acorn Systems software cost Peregrine some $80,000. Of course, that's a bargain compared with similar products by vendors that include Zilliant Inc., Vendavo Inc., and I2 Technologies. For instance, I2 is charging big corporations as much as $1 million. Despite the hefty price tag, the market for such software is expected to grow 800%, to $900 million, by 2007, according to AMR Research.

Is it worth the investment? That depends on the scope of your business. If you only have, say, 10 customers and one or two products, you can probably live without it. Just encourage your sales reps to follow the lead of the diligent pharmacist by breaking down each order by customer, product, and order size to figure out where money is being saved or lost. But the more complex your business is, the more valuable the software becomes. Olsen says Acorn's profit analyzer software was worth the investment, which he expects to recoup by March 2004. "What the software's taught us about our business is invaluable," he says. "After 15 years, we're finally focused on profitability."