Mutual funds are one of the few circumstances where you can average your cost to determine your basis for the funds sold.
Combine the total amount paid for the mutual funds immediately before the sale and then divide that total by the number of shares held immediately before the sale. Next, multiply that by the number of shares sold to arrive at your cost basis for the shares sold.