The Navy List, the Royal Navy’s official published list of officers, available on Ancestry, now has issues at intervals of about two years except during the two world wars when they were published more frequently.
Use it for researching the career of an officer in the Royal Navy, Royal Marines, Queen Alexandra’s Royal Nursing Service, Coast Guard, and other naval entities. The list includes both commissioned and warrant officers, and along with names, lists can indicate rank, seniority, decorations, and other details.
The Navy List includes numerous groupings. For example, officers are grouped by rank. These include admirals, commanders, captains, lieutenants, chaplains, carpenters, boatswains, artificer engineers, gunners, surgeons, and others. There are also lists of ships with their officers and current stations, as well as lists of pensioners and retired officers.
Contents varied over the years. It’s bit of a lucky dip! You will find officers in the Royal Naval Reserve (RNR—including the New Zealand Branch) and Royal Navy Volunteer Reserve (RNVR—including the South African Division), the Royal Naval School of Music, the Royal Humane Society medal roll (where you may find enlisted men included), as well as lists of clerks, schoolmasters, civilian dental surgeons, warrant writers, warrant armorers, head schoolmasters, head stewards, and others.
Findmypast has a Navy List collection from 1827 to 1945 and the free coverage via The Internet Archive/Google Books is almost as good.