Chad Cochran, a longtime video production, animation and technology teacher at San Ramon Valley High School, got the news from Ferrell's publicist on Monday.
The star of movies such as "Elf" and "Anchorman: The Legend of Ron Burgundy" will be in Europe during the school's senior ball on May 10.
"We're all pretty sad around here, but at least we got an answer," Cochran said.
The 34-year-old teacher said the idea to ask Ferrell to chaperone the prom with him came during a brainstorming session with his leadership video class as they studied how Internet videos go viral, he said.
With his students' help, Cochran put together a video in which he explains that while he is happily married with two children and two dogs, his wife won't be able to make it to the prom.
"So I kinda need someone to go with me," he explained in the video.
Cochran promised Ferrell that their prom date would include a chocolate fountain, riding in a school bus and a boutonni?re purchased from a chain grocery store.
One of the actor's high school dance photos was superimposed with Cochran's face to give Ferrell an idea of what their prom pictures might look like.
The video went viral, making the rounds on websites and news channels across the country and as far as Australia. Cochran said he heard from people he hadn't spoken to in years.
"Someone said, 'Hey, I just saw you in a taxicab in New York,'" he said.
So when the teacher and his students heard nothing back from Ferrell, "We decided it was time to step it up and make one more video," he said.
The second video featured dozens of students as Cochran tours the San Ramon Valley High campus.
And while many of them are feeling the disappointment along with their teacher this week, he said the experience has been a positive one.
"It was wonderful for all my classes, and I think the whole campus, to learn about social media and viral videos and how fast something can travel," Cochran said.
He said he's now working on his wife's co-workers to change their schedules so she can be his date to the prom after all.
"She thinks it's really funny, but I think she's glad it's over now," Cochran said. "She's ready to have me talk about something other than Will Ferrell."