Bartz, who will begin her new position immediately and join the board, worked at Autodesk, a computer aided design software company for 14 years and became chairman in 2006.
During her tenure as chief executive, revenues increased from less than $300m to more than $1.5bn. She has little Web 2.0 or advertising experience, but has a strong technology background, sitting on the boards of Cisco Systems, Intel Corporation and NetApp.
Reports of her appointment sent Yahoo! shares down by 1% to close trading in New York yesterday at $12.10.
Roy Bostock, chairman of the Yahoo! board, said: "We are very excited to have Carol Bartz leading Yahoo! into its next era of growth.
"She is the exact combination of seasoned technology executive and savvy leader that the board was looking for, and we are thrilled to have attracted such a world-class talent to Yahoo!.
"She is admired in the Valley as well as on Wall Street for her deep management expertise, strong customer orientation, excellent people skills, and firm understanding of the challenges facing our industry."
Search firm Heidrick & Struggles, which headed up the CEO search, has said that Yahoo! would also be looking for a strong number 2 with more internet and product experience if a CEO with less online background was selected.
The search firm is thought to have received a number of rejections as candidates turned down what many see as a very difficult job.
The immediate consequence of Bartz's appointment is the swift resignation of Yahoo! president Sue Decker. She will leave after remaining with the company for a transitional period.
Decker had been touted as a possibility to take the chief executive role, along with Jonathan Miller, a former head of AOL.
Bartz, who has had executive experience at Sun Microsystems, Digital Equipment Corporation and 3M, admitted she faced an enormous struggle.
Bartz said: "There is no denying that Yahoo! has faced enormous challenges over the last year, but I believe there is now an extraordinary opportunity to create value for our shareholders and new possibilities for our customers, partners and employees. We will seize that opportunity."
Bartz replaces Yang who announced his resignation last November, 17 months after he was asked to again take the reins at the company he founded in 1995.
He is still a member of the board, but has returned to his former role as chief Yahoo!, focusing on global strategy and inspiration rather than executive leadership.
His resignation was seen as the consequence of his failure to please investors on two fronts.
Many held him responsible for the company losing out on the $44.6bn (£30bn) Microsoft deal earlier this year. Yang was understood to be waiting for a higher offer, but was also antagonistic to the software giant.
As an alternative strategy, Yang pursued talks with AOL and reached a ten-year search advertising alliance that would have seen Yahoo! profit from allowing Google-sold entries to appear in its listings. However, the alliance fell apart after opposition from the US Department of Justice.
He subsequently admitted that Yahoo!'s best option was to reach a deal with Microsoft, but his admission and dithering was seen by some as too little, too late as the window of opportunity with the software giant had closed.
Bostock said: "On behalf of the entire board, I would like to thank Jerry Yang for acceding to our request 18 months ago to step into the CEO role.
"Jerry's unwavering enthusiasm for Yahoo!, his unique perspective on the company, and iconic stature in the industry make him an invaluable resource for the future. We are delighted that he plans to stay actively involved and are deeply grateful for his many contributions to the company's development over the years."
Yang said: "I couldn't be more pleased with the board's choice of Carol Bartz as CEO and look forward to returning to my former role as Chief Yahoo!.
"I believe Carol is the ideal person to take Yahoo! forward and I will be honoured to be a resource to assist her in any way she finds helpful. I believe Yahoo!'s best years are still ahead of it.
"For the past 14 years, I have poured all of my energies into this great company -- and I hope to keep contributing to its success for many years to come."