Shepherd will play Daphne, a woman traveling to New York on the same flight as Marshall, played by "HIMYM" regular Jason Segel.
The sitcom is to kick off its ninth and final season Sept. 23.
"We're all extremely excited to have Sherri Shepherd joining 'HIMYM' for an arc in Season 9," the show's co-creator and executive producer Craig Thomas said in a statement Monday. "She is hilarious and delightful and perfect for this part -- we couldn't be more thrilled."
A co-host on "The View," Shepherd has appeared in numerous television series and feature films including "Everybody Loves Raymond," "Sherri," "30 Rock," "Less than Perfect," "Dancing with the Stars" and "Precious."