William O'Byrne's Naval Biographical Dictionary contains brief biographical notes on every officer of the Royal Navy living in 1849, in alphabetical order of surname, and is thus a treasure trove for anyone with such ancestors of connections. Volume 1 (see url below) is on Google Books and ends with a Captain M'Farland. Both volumes are, I believe, searchable on Ancestry.com.
A naval biographical dictionary ... - Google Books
A naval biographical dictionary ... - Google Books