Harris co-wrote and co-produced the bonus track "One Life" for R&B singer Mary J. Blige's album My Life II... The Journey Continues (2011). He also worked with the pop band Scissor Sisters on the single "Only the Horses" from their fourth studio album, Magic Hour. He wrote and produced Cheryl Cole's single "Call My Name", the lead single from her third album A Million Lights. He also produced a remix of Florence and the Machine's "Spectrum" titled "Spectrum (Say My Name)". The song was released as the album's fifth single on 5 July 2012. It was serviced to radio in the UK on 2 July 2012. It became the group's first single to peak at number one on the UK Singles Chart.
"Let's Go" featuring Ne-Yo, the third single from the album, was released in April 2012 and reached number two in the UK Singles Chart. It was his second US Billboard Hot 100 appearance as a main artist, charting at number 17. The song received a nomination for Best Dance Recording at the 55th Grammy Awards which was held in February 2013. The album's fourth single "We'll Be Coming Back" was released in July 2012. Featuring rapper Example, it peaked at number two in the UK. The fifth single, "Sweet Nothing", features Florence Welch of Florence and the Machine and was released on 14 October 2012. It peaked at number one on the UK Singles Chart and at number 10 on the US Billboard Hot 100. The song received a nomination for Best Dance Recording at the 56th Grammy Awards.
His third studio album, 18 Months, was released on 29 October 2012. Harris eventually made UK chart history by becoming the first artist to attain eight top-10 singles from one studio album, breaking the record previously set by Michael Jackson. In March 2017, the record was surpassed once again by Ed Sheeran, after his album ÷ spawned 10 top-10 songs on the UK chart. 18 Months received a nomination for Best Dance/Electronica Album at the 56th Grammy Awards. Harris was also nominated for Best British Male Solo Artist at the 2013 Brit Awards in February.
In 2012, Harris was featured in the Pepsi Max commercial for their football campaign. Titled "crowd surfing", the advert showed Harris on the DJ deck playing his single "Let's Go" to the crowd of partygoers alongside star footballers Lionel Messi, Didier Drogba, Fernando Torres, Frank Lampard, Sergio Agüero and Jack Wilshere. In 2013, Harris teamed up with Sol Republic to create their first studio-tuned, professional-calibre headphones. The partnership involved designing a customised look for the headphones and redesigning its drivers to Harris's specifications.
In early 2012, Harris signed an exclusive DJ residency deal with Wynn Las Vegas which included gigs at three of the luxury resort's avenues: Encore Beach Club, Surrender and XS Nightclub. In February 2013, Harris signed as the first exclusive resident DJ with the Abu Dhabi-owned hospitality company Hakkasan Group in Las Vegas. The 20-month residency saw him play 46 dates at MGM Grand's Hakkasan nightclub, as well as 22 additional gigs at the MGM Grand's Wet Republic. In January 2015, he extended his partnership with the Hakkasan group for three more years, which includes residencies at three of the group's Las Vegas venues (Hakkasan nightclub, Wet Republic and Omnia Nightclub at Caesars Palace). Harris also serves as the Group's music consultant for its restaurants, nightclubs and hotels, globally.
In February 2012, Harris teamed up with several other artists (including Rihanna and Coldplay) to perform at a charity concert with all proceeds from the show going to the Children's Orthopaedic Center at the Children's Hospital Los Angeles. In November 2012, Harris contributed several songs to Tiësto's compilation album Dance (RED) Save Lives in collaboration with anti-AIDS charity Product Red which was aimed at creating awareness on the fight for an AIDS Free Generation. Harris participated in a global live stream of the Stereosonic music festival in Melbourne, Australia which took place on World AIDS Day on 1 December 2012. The proceeds from both the album and the event were donated for the cause.