From Deadline.com:
Will Ferrell has committed to a four-episode arc of The Office. He will play a branch manager who comes from the home office and is just as inappropriate as Steve Carell’s Michael Scott character. Ferrell has committed to one episode beyond Carell’s finale, to help create a bridge.
From NBC:
“We found Steve Carell when he was nothing but a movie star and we turned him into a television star,” said executive producer Paul Lieberstein. “We are proud to continue ‘The Office’s’ tradition of discovering famous talent, and we hope that once America gets a good look at Will, they’ll see what we see: tremendous raw sexuality.”
Here is the schedule of Ferrell’s appearances on The Office.