Anderson returned to the Pacific in early 1942 and remained in that ocean for the rest of her service. She accompanied carrier Yorktown (CV 5) in the South Pacific in March and April, screened Lexington (CV 2) during the Battle of the Coral Sea in early May and then was back with Yorktown a month later for the Battle of Midway. When carrier Hornet (CV 8) was sent to join the Guadalcanal campaign, Anderson went along and generally operated with Hornet until her loss in the late October 1942 Battle of the Santa Cruz Islands.
For the rest of the Guadalcanal Campaign, and beyond, Anderson remained in the South Pacific, screening heavy ships, escorting convoys, bombarding the enemy ashore and carrying out patrols. She returned to the US for overhaul in March 1943 and went north for Aleutians operations during July–September. The destroyer’s next assignments were to support the invasions of the Gilbert Islands in November 1943 and the Marshalls in early 1944. She was hit by Japanese coast-defense gunfire while bombarding Wotje on 30 January. Further damaged by grounding two days later, Anderson was under repair until mid–June 1944. July–November 1944 was spent with the Seventh Fleet, including participation in landings at Morotai and Leyte. During the latter operation, on 1 November, she was hit by a Japanese suicide plane and again had to return to the West Coast for repairs.
Back in service in the spring of 1945, Anderson was assigned to the North Pacific theatre, where she participated in a number of bombardments and anti-shipping sweeps. Following Japan’s surrender, she took part in occupation activities for a few months before steaming eastward across the Pacific to San Diego, California.
In early 1946, Anderson voyaged back to Pearl Harbor, where she stayed until May, then proceeded on to the Marshall Islands for use as a target ship in the “Operation Crossroads” nuclear weapons tests. Anderson was expended on 1 July 1946 in the “Able” atomic bomb explosion at Bikini Atoll.