Here's CollegeRPI.com's formula
This is an explnation of the core basics.
What is the RPI?
The RPI (Rating Percentage Index) is a measure of strength of schedule and how a team does against that schedule. It does not consider things like margin of victory, only whether or not a team won and where the game was played. It is used by the NCAA as one of their factors in deciding which teams to invite to the NCAA tournament and where to seed them. It was created in 1981 and is maintained by the NCAA Division I Men's Basketball Committee. They have always placed a premium on schedule strength when selecting teams for the tournament, so they wanted a relatively simple way to measure that and the RPI was born. This page presents an independent duplication of those ratings.
What is the formula?
The basic formula is 25% team winning percentage (WP), 50% opponents' average winning percentage (OWP), and 25% opponents' opponents' average winning percentage (OOWP).
Beginning with the 2004-05 season, the formula was changed to give more weight to road wins vs home wins. A team's win total for RPI purposes is 1.4 * road wins + neutral site wins + 0.6 * home wins. A team's losses is calculated as 0.6 * road losses + neutral site losses + 1.4 * home losses.
For example, a team that is 4-0 at home and 2-7 on the road has a RPI record of 5.2 wins (1.4 * 2 + 0.6 * 4) and 4.2 losses (0.6 * 7). That means that even though it is 6-7, for RPI purposes, it is above .500 (5.2-4.2).
This "weighted" record is only used for the 25% of the formula that is each team's winning percentage. The regular team records are used to calculate OWP and OOWP.
As always, only games against Division I opponents count in the RPI.
Do you adjust the OWP to account for the fact that they have played the team in question?
Yes. Games against the team in question are ignored.
Does the NCAA make these adjustments too?
Yes.
In the OWP, do you include the records of teams scheduled in the future?
No. A team's is included as an opponent in the calculations only after the game is played. This is because a team's entire schedule is not usually known, mostly due to games added because of in-season and conference tournaments. Also, sometimes games get cancelled.
Do you use the record of an opponent at the time the game is played or at the time the RPI is calculated?
The RPI is always calculated based on current records, not date-of-game records.
If a team plays somebody more than once, is their winning percentage included more than once?
Yes. Once for each time a team plays that opponent. And all games against the team in question are removed from each occurrence of that opponent's record when calculating OWP.
My head is spinning, but basically it's who you played, where you played 'em, who you lost to & who you beat. ... and you want your opponents to do well (except when you play them).