Hello everyone and welcome to the pre-recorded discussion of Flowers Foods Q4 and full year 2021 results. This is JT Rieck, SVP of Finance and Investor Relations. As a reminder, we released our Q4 and full year 2021 results on February 10th, 2022. Along with the transcript of these recorded remarks from our Chief Executive Officer and Chief Financial Officer, you can find the earnings release and related slide presentation in the investor section of flowersfoods.com. We will host a live Q&A session on Friday, February 11th at 8:30 A.M. Eastern. Further details are posted in the investor section of our website. Before we get started, keep in mind that the information presented here may include forward-looking statements about the company's performance.
Although we believe these statements to be reasonable, they are subject to risks and uncertainties that can cause actual results to differ materially. In addition to what you hear in these remarks, important factors relating to Flowers Foods business are fully detailed in our SEC filings. Providing remarks today are Ryals McMullian, President and Chief Executive Officer, and Steve Kinsey, our Chief Financial Officer. Ryals, I'll turn it over to you.
Thanks, JT. It's a pleasure to welcome everyone to our Q4 call. I'm very proud of our performance last year in what was a challenging and dynamic environment. The situation leading into the year was unprecedented, with inflation, supply shortages, labor challenges and shifting demand as the pandemic changed the way people live and work, creating new shopping and eating habits that continue to evolve. In the face of this uncertainty, our team rose to the challenge and delivered another strong financial performance. We exceeded our initial 2021 guidance, and on each measure, sales, EBITDA, and EPS growth remain ahead of our long-term financial targets with 2019 as the base year.
It's important to note that excluding the impact of the extra week in the prior year, we overcame difficult comps and increased sales in both the Q4 and the full year.
Our leading brands continue to gain market share, driven by investments in innovation and marketing. Building off those results, we move into 2022 with confidence. To offset the higher than expected costs in the Q4, we implemented an across-the-board price increase in January, which along with continued growth from our leading brands, is driving strong early performance in 2022. Now I'd like to focus on our four strategic priorities, starting with our team. 2021 was an extraordinary year that challenged us all, and I'm grateful to our Flowers team, particularly our frontline workers, for all of their efforts. A scarcity of labor and quarantines related to COVID-19 outbreaks and exposures contributed to staffing shortages, making production difficult at times.
Through it all, our Flowers team pulled together to overcome these headwinds, getting our category leading products on the shelves to meet consumer demand.
It's impossible to thank our team enough for this effort, but to recognize their commitment and hard work, we awarded $5.2 million of appreciation bonuses to our frontline workers in the Q4. One of the key learnings from the pandemic has been our ability to adapt to remote working. Beyond our bakeries, we've capitalized on this new virtual work environment, using it to expand the talent pool from which we recruit. This flexibility has allowed us to supplement an already strong team with talent from across the country, which is particularly important considering the additional capabilities our digital transformation requires. Our second strategic priority is focusing on our brands. Prior to the pandemic, we pivoted to become a more brand-focused company, and our leading brands continue to perform very well.
Our household penetration grew significantly over the last two years.
Importantly, we've held on to many of those new customers and further increased penetration of our leading brands in 2021. Since 2019, our household penetration has increased 300 basis points, with Nature's Own up 460 basis points, Dave's Killer Bread up 350 basis points, and Canyon Bakehouse up 70 basis points. Consumers are also increasing the number of times they buy our products, with repeat rates up 270 basis points since 2019. These improved metrics are driving sales and market share gains. Nature's Own, Dave's Killer Bread, and Canyon Bakehouse grew 2021 track channel sales by 0.3%, 11%, and 16% respectively, despite the difficult prior year comparisons. Those top brands also gained a combined 60 basis points of market share.
Innovation has been a key growth driver for our top brands, so we're making significant investments to continue that growth by bringing new products to market. Products such as Nature's Own Perfectly Crafted Flatbreads, Dave's Killer Bread and Nature's Own Perfectly Crafted Rye filled market segments where we were unrepresented previously. I've spoken on past calls about our new Agile Innovation Group, which is tasked with accelerating the development of truly innovative new products that are outside of our core categories. I'd like to highlight the first product that we've commercialized as part of that effort, our DKB snack bars. The bars, which come in three flavors, offer the same killer taste, texture, and nutrition that DKB fans have come to love with the ease of a grab-and-go product.
They will also offer access to the direct-to-consumer channel that many of our products do not.
You can see a representation of these bars in the slide deck. DKB's brand strength enables it to expand to different categories in ways that other brands can't. When our loyal DKB consumers, affectionately known as BreadHeads, expressed a desire for DKB products beyond loaf bread, we introduced bagels, English muffins, and burger buns, all of which have been met with strong demand. That success gave us the confidence to expand the product line beyond bread. The snack bars are being tested in several markets and have shown strong initial results that are exceeding our own expectations. We're excited about the promise of these new products and the potential for additional developments from our Agile Innovation Group.
Our pipeline is full, and we plan to bring more innovation to market later this year. Our third strategic priority is margins, an area that has taken on particular importance in this period of rising inflation. In part, earnings declined in 2021 due to continued labor challenges and inflationary pressures. Q4 margins, in particular, compressed as we transitioned to higher priced hedges and our pricing actions lagged cost increases. However, we have plans in place to offset these pressures through a combination of internal efficiencies, price increases, and steps to improve our hiring process and working conditions, particularly in the bakeries. In 2020 and 2021, our portfolio optimization program saved a total of $60 million. For 2022, we've initiated additional cost savings measures, primarily across operational efficiencies and procurement.
We expect these programs to deliver an incremental $25 million-$35 million in savings for the year. Our digital transformation initiative is a crucial driver of improved data and efficiencies. When we launched this initiative, I highlighted some of the digital domains we were focusing on initially. These domains included Bakery of the Future, eCommerce, and autonomous planning. The Bakery of the Future domain, among its many benefits, is expected to provide new business metrics, real-time performance management, and automate repetitive processes. We expect those changes to translate into meaningful benefits, such as reduced scrap and labor expenses, even more consistent product quality, and ultimately, lower production costs per hour. We've already launched pilots at several bakeries, and we expect to deploy this program to half of our bakeries by the end of the year.
We expect the e-commerce domain to improve digital content and develop new partnerships to enhance the reach of our products. Our ultimate goal is to become the category leader, driving sales at traditional retailers, websites, online retailers, and last mile delivery partners. The goal of autonomous planning is to digitally connect the various pieces of our supply chain, allowing us to predict consumer demand with higher accuracy and integrate that insight from point of sale through the supply chain to ensure the right raw materials are on-site at the right time, the right products are produced at the right bakery every day, and deliveries are optimized to achieve high on-shelf availability and customer service. These digital domains and others are expected to drive greater sales and efficiencies, enabling us to meet or exceed our long-term financial targets.
Of course, underpinning all of these digital initiatives is the upgrade of our ERP system. We have completed the design phase and moved into the build phase, and this upgraded system will deliver better data, automate processes, and enable us to become a more digitally agile company with the ability to leverage data and technology to further improve efficiencies, operations, and service. We've also talked about our focus on improving operations, particularly at our underperforming bakeries, including the Navy Yard. I'm pleased with the dramatic progress we've made in this regard, and although we still need to make further improvements, I'm confident that those results will continue to improve.
When internal initiatives are not sufficient to offset inflation, as in the current environment, we also turn to price increases. The first price increase in the current cycle came in July 2021.
However, as hedges transitioned to higher prices in the Q4, the inflationary impact increased faster than expected. To offset this cost pressure, we implemented a second price increase in January of this year. Input costs were volatile at the time we took that proposed pricing to the market, and since then, our inflation expectations for 2022 have increased. Our early analysis of results so far in 2022 suggests that this price increase is covering much of the current inflationary pressure, though more pricing actions may be warranted in certain categories. We'll continue to closely monitor the results and take any additional actions necessary. Our fourth priority is smart M&A. We continue to monitor the deal market, which remains active.
Valuations are high, but our steady free cash flow and strong balance sheet position us well to act when we have financial, commercial, and operational conviction. As always, we will maintain our disciplined approach. Now I'll turn it over to Steve to review the details of the quarter, and then I'll come back a little bit later to discuss our outlook for the current business environment. Steve?
Thank you, Ryals, and hello, everyone. I'd like to echo your comments on our incredible team and express my sincere thanks for their outstanding efforts. As a reminder, 2021 was a 52-week year, one less week than in 2020, with the extra week falling in the Q4. The impact of the extra week in 2020 was approximately 1.7% to the top line and $0.02 per share. Given the pandemic influence on year-over-year comparisons, in some circumstances, we will also provide comparisons to the pre-pandemic results in the Q4 of 2019. As Ryals mentioned, we are very pleased with our 2021 performance.
In the Q4, total sales decreased 3.9% from the prior year period, but rose 3.8% excluding the extra week in 2020 and 7.2% compared to the Q4 of 2019. Improved price mix drove the adjusted year-over-year increase, up 6.2%, more heavily weighted to price than mix. The primary factors were price increases to mitigate inflationary pressures and growth in our more profitable branded retail products. Partially offsetting the sales increase was a 2.4% volume decrease, mostly driven by declines in our retail business, particularly store-branded retail. Looking at sales by channel, branded retail sales decreased $26.9 million compared to the prior year, or 4%, to $649.9 million.
This decrease was driven primarily by volume declines from the extra week in the prior year period and moderating at-home food consumption, partially offset by favorable price mix and improved promotional efficiency. Despite the difficult prior year comparisons, Flowers' fresh packaged bread gained 10 basis points of market share in tracked channels. Excluding the extra week in the prior year period, sales of Nature's Own increased 4% and Dave's Killer Bread and Canyon Bakehouse each rose 15%. Compared to the Q4 of 2019, branded retail sales increased 17.9% as our leading brands continued to benefit from pandemic-related demand increases and our initiatives to drive further growth. Store branded retail sales decreased $20 million year-over-year, or 14.6% to $116.8 million as consumers continued to express a preference for more differentiated branded products.
The store branded category as a whole lost 120 basis points of market share in the Q4 compared to the prior year period, declining to 18.8%, a downward trend that has endured for seven years. Compared to the 2019 Q4, Flowers store branded sales declined 17%. Non-retail and other sales increased $7.4 million year-over-year, or 3.5% to $216.8 million as we lapped pandemic-induced declines in the prior year period. Results benefited from improved price mix, partially offset by lower volume due to the extra week in the prior year period. Non-retail and other sales overall remained below pre-pandemic levels, with sales down 4% compared to the 2019 Q4.
However, as non-retail sales continue their recovery, that business is coming back at higher margins due to the initiatives we've taken to improve the profitability of the business overall. In the Q4, gross margin as a percent of sales, excluding depreciation and amortization, decreased 110 basis points to 47.9%. Gross margin comparisons were impacted by lower sales and higher ingredient and packaging cost, partially offset by lower incentive compensation expense and reduced outside purchases. Selling, distribution and administrative expenses increased 110 basis points as a percentage of sales in the Q4. Excluding the items affecting comparability detailed in the press release, adjusted SD&A expenses increased 100 basis points to 38.9%.
Results were primarily impacted by a $3.9 million prior year reimbursement for indirect losses associated with receiving inferior ingredients and higher labor, logistics, and marketing costs. GAAP diluted EPS for the quarter was $0.18 per share, compared to $0.26 in the prior year period. Excluding the items affecting comparability detailed in the release, adjusted diluted EPS in the quarter was $0.20 per share, down $0.08 from the prior year period. The impact of the extra week in the prior year was $0.02 per share. Turning now to our balance sheet, liquidity and cash flow. For fiscal 2021, cash flow from operating activities decreased by $109.9 million to $344.6 million, largely due to lower adjusted earnings and greater working capital usage.
Capital expenditures increased $38 million to $136 million, largely due to digital investments and production capacity additions. Dividends paid increased $8.6 million to $175.9 million. Additionally, to further optimize our distribution network, we purchased a portfolio of leased facilities for $64.7 million, which also impacted cash flow from investing activities. Our financial position remains strong. At year-end, net debt to trailing twelve-month adjusted EBITDA stood at approximately 1.4 x compared to 1.1 x at the end of the Q3. At year-end, we held approximately $186 million in cash and cash equivalents and had approximately $686 million of remaining availability on our credit facilities. Turning to our adjusted outlook for 2022.
We are forecasting sales to increase 7.6%-8.4% versus 2021, which at the midpoint implies a 4.3% compounded annual growth rate off the 2019 base. Our guidance range for adjusted EPS is $1.25-$1.35 per share, which at the midpoint implies 4.8% growth compared to the prior year and a 10.6% compound annual growth rate off of the 2019 base. This guidance exceeds our long-term financial targets of 1%-2% sales growth and 7%-9% EPS growth off the 2019 base. Regarding earnings cadence, while our January pricing initiatives will impact the full year, the benefits of many of our growth and efficiency initiatives are expected to occur in the back half of 2022.
Some of the factors we considered when setting guidance, including inflationary pressures, our ability to take additional pricing and the resulting demand elasticity. Variations among these factors could drive our actual results to the top and bottom of the ranges provided. As we messaged last year, inflation is meaningfully higher in 2022. In total, we are expecting high single-digit cost increases. Prices for commodities such as flour, fats and oils, and packaging have risen significantly, and we are doing everything in our power to offset these higher costs. Our hedging strategy, in which we attempt to lock in commodity prices 6-12 months out, provides visibility into future inflation. Approximately 70% of our key raw materials are covered for 2022. So far, we've been successful in obtaining higher prices necessary to offset inflation with some lag effect in the Q4.
We remain optimistic that, combined with our internal actions, we should be able to mitigate the impact of higher costs in 2022. As you are aware, we embarked on a robust digital transformation in 2021. Ryals discussed the investment we are making in our digital transformation initiatives and the benefit we expect from them. It's important to note that the largest portion of that initiative is upgrading our ERP system to S/4HANA. With the planning and design phases complete, we have good visibility into the overall size and expected financial magnitude of the investment. We expect that the total cash investment for the design and implementation of our ERP program from 2021 through 2026 will be approximately $275 million, of which approximately 40% will be capitalized.
In fiscal 2021, ERP spending was about $47 million, of which approximately $22 million was capitalized. For fiscal 2022, we anticipate approximately $85 million-$95 million of ERP-related project cost. We expect to capitalize roughly $65 million-$75 million of that amount. As we've discussed before, our digital strategy initiative is designed to transform how we operate our business, and we expect these investments to drive sustained efficiencies, enabling us to meet or exceed our long-term financial targets. Thank you, and now I'll turn it back to Ryals.
Thank you, Steve. As you've just heard, despite an inflationary outlook and the potential for demand elasticity, we head into 2022 with confidence. At the beginning of 2021, we highlighted three factors to watch, the amount of demand reversion, cost inflation, and our ability to offset it, and changes in the promotional environment. Later in the year, as inflation accelerated, we added one more factor, demand elasticity, which holds particular importance as we enter 2022. The pandemic triggered a significant shift in our mix, driving demand for branded retail products while curtailing non-retail sales and accelerating the long-standing decline in private label. That mix shift boosted our margins significantly and highlighted the benefits of our brand-centric portfolio strategy, which we had begun implementing even prior to the onset of the pandemic.
During the second half of 2021, we started to see some signs of strength in our food service business, which is off its lows as consumers begin to eat more often outside of the home. We've also been very pleased by the resiliency of our branded retail sales, which represented 60% of sales pre-pandemic, rose to 66% in 2020, and remained at that level in 2021. Part of the strength is due to the increase in at-home eating as many workers remain remote, but we believe some is also attributable to the strength of our brands and consumers' demand for the differentiated attributes and quality of these products. Store brand sales continue to lose share as consumers express their preference for differentiated products and are willing to spend more for what they see as greater value.
As Steve noted, even with rising inflation, store brand share of the category continued to decline in the Q4, losing 120 basis points compared to the prior year Q4. The second factor we're watching is inflation, which was picking up as we entered 2021 and then intensified throughout the year. We took measures to mitigate inflation including our traditional hedging activity, internal efficiencies, and a price increase that was implemented last July. Those measures were successful, though as many of our older hedges ran off in the Q4 and were replaced by new hedges at higher prices, they were not sufficient to completely cover these higher costs. We implemented a second price increase that took effect in January, which we expect, in conjunction with our other measures, will mitigate inflationary pressures in 2022.
As I mentioned in my opening remarks, should inflationary pressure increase further, we stand ready to take additional action to offset it. The third factor coming into 2021 was the promotional environment. Our markets are always competitive, but we've not detected any significant changes here. Overall, competition has remained rational as the benefits of aggressive widespread promotions are limited in a market where costs are increasing and supply is limited. The final factor we were watching is demand elasticity. As we said last quarter, one of the primary factors influencing results in 2022 will be how much inflation consumers can absorb as nearly every aspect of their household spend increases. So far, we've not seen a meaningful reduction in demand due to our two price increases, and we're hearing similar commentary from other companies in the consumer goods space.
The early indications this year are that units are holding up well and our trade promotion rate remains low. I have seen some research that suggests consumers are beginning to look for value as prices rise, but so far, that dynamic has been less apparent in the bread category. In fact, most of the category softness has been confined to lower priced, less differentiated products. Premium items such as Nature's Own Perfectly Crafted, Dave's Killer Bread, and Canyon continue to generate growth in dollars and units. That product mix gives us confidence that 2022 has the potential to be another very strong year. However, if consumers begin to trade down to lower priced products, that could put some temporary pressure on margins until the current inflationary environment subsides.
Looking to 2022, we are focused on continuing improvement with an emphasis on our four strategic priorities, our team, our brands, margins, and M&A. I've said before that I think we've got the best team in the industry, and we're working to strengthen that team and make our work environment the best that it can be. Our brands have never been stronger, and we're investing in them to continue their growth. We believe that brand strength is one reason we haven't seen much demand elasticity despite higher prices. We're investing in our future margin profile with our digital transformation initiative, the foremost example of that. Think of our digital strategy as a key enabler of our overall strategic priorities.
Successful implementation of digital will support our brand efforts, bringing us ever closer to the consumer, increase our efficiencies and operations, and deliver higher quality, real-time insights to the team, which will in turn support faster, higher quality business decisions. We believe that the near term investment will drive sustained margin improvement. Finally, we aim to strengthen our existing business with M&A to bolster our already strong brand lineup and growth profile. Before we close, I'd like to add a little bit more clarity around what's contemplated within our guidance range. As I said earlier, our 2022 guidance points to another strong year for Flowers, particularly at the upper end of the range.
While we considered many factors in formulating our guidance, two factors will have the greatest impact on the year. The first is demand elasticity, and the second is the timing of our efficiency initiatives.
As we said, our early analysis suggests that consumers are absorbing the price increases well, but we will need to get a little bit further into the year for a more complete picture. Also, given the success of our portfolio optimization initiative, which generated $60 million in savings over the last two years, I am confident in our ability to deliver incremental value. However, a timing shift in those initiatives could impact overall results this year. Consumer trade down to lower priced products and the timing shift in our savings initiatives could move results toward the lower end of the range. Continued strong demand for our premium brands and timely delivery of savings would help drive results toward the upper end of the range.
At the end of the day, we're hard at work impacting the things within our control. Investing in our top brands, managing our cost, building new capabilities, cultivating our culture, and celebrating our people. In closing, I'm extremely proud of our 2021 performance, and I'm optimistic about the initiatives we have in place to ensure our success in 2022 and beyond. Thank you very much for your time. This concludes our prepared remarks.