In total, we invested approximately $248 million in response to the pandemic in 2020, including about $167 million in appreciation bonuses for eligible front-line employees to demonstrate our appreciation for their exceptional performance during an incredibly challenging year.
At Dollar General, we remain committed to being part of the solution, and believe we are uniquely positioned to continue supporting our customers through our network of more than 17,000 stores located within five miles of approximately 75% of U.S. population.
Similar to our larger footprint, DGP concept, the first new format has selling space of approximately 8,500 square feet, which compares to about 7,300 square feet of selling space for our traditional store.
Our second new format is even larger with approximately 9,500 square selling feet, and will be deployed opportunistically across new store relocation and remodel opportunities.
In total, fourth quarter net sales increased 17.6% to $8.4 billion, primarily driven by comp sales growth of 12.7%.
Once again, this quarter, we increased our market share in highly consumable product sales, as measured by syndicated data, driven by a meaningful increase in both units and dollars.
We're particularly pleased that we delivered significant operating margin expansion, which contributed the fourth quarter diluted earnings per share of $2.62, an increase of 24.8% over the prior year.
For the full year, net sales increased 21.6% to $33.7 billion, including net sales growth of 28.1% in our combined non-consumable categories.
Comp sales for the year increased 16.3%, representing our 31st consecutive year of same-store sales growth.
In 2020, we celebrated the opening of our 17,000 store and the launch of our newest store concept pOpshelf.
In total, we completed a record 2,780 real estate projects during the year, exceeding our initial target of 2,580 projects as we continue to build and strengthen the foundation for future growth.
Gross profit as a percentage of sales was 32.5% in the fourth quarter, an increase of 77 basis points, which represents our seventh consecutive quarter of year-over-year gross margin rate expansion.
SG&A as a percentage of sales was 22.2%, an increase of 48 basis points.
Operating profit for the fourth quarter increased 21% to $872 million.
As a percent of sales, operating profit was 10.4%, an increase of 30 basis points.
The benefit from higher sales was partially offset by approximately $96 million or 110 basis points of incremental investments that we made in response to the pandemic, including approximately $69 million in appreciation bonuses for eligible frontline employees and additional measures taken to further protect our employees and customers.
Our effective tax rate for the quarter was 22.7% and compares to 23% in the fourth quarter last year.
Finally, as Todd noted earlier, earnings per share for the fourth quarter increased 24.8% to $2.62, which contributed to full year earnings per share of $10.62, an increase of 59.9%.
Merchandise inventories were $5.2 billion at the end of the year, an increase of 12.2% overall and 6.3% on a per-store basis.
In 2020, we generated significant cash flow from operations totaling $3.9 billion, an increase of $1.6 billion or 73.2%.
Total capital expenditures for the year were $1 billion and included our planned investments in new stores, remodels and relocations, distribution and transportation projects and spending related to our strategic initiatives.
During the quarter, we repurchased 4.3 million shares of our common stock for $900 million and paid a quarterly dividend of $0.36 per common share outstanding at a total cost of $87 million.
With today's announcement of an incremental share repurchase authorization, we have remaining authorization of approximately $2.4 billion under the repurchase program.
We also remain committed to returning significant cash to shareholders through anticipated share repurchases and quarterly dividend payments, all while maintaining our current investment-grade credit rating and managing to a leverage ratio of approximately 3 times adjusted debt to EBITDA.
With this in mind, we currently expect the following for 2021: net sales in the range of a 2% decline to flat; a same-store sales decline of 4% to 6% but which reflects growth of approximately 10% to 12% on a two-year stack basis; and earnings per share in the range of $8.80 to $9.50, which reflects a compound annual growth rate between 15% and 20% or between 14% and 19% on an adjusted basis over a two-year period, which is well above our long-term goal of delivering at least 10% annual earnings per share growth on an adjusted basis.
Our earnings per share guidance assumes an effective tax rate in the range of 22% to 23%.
Capital spending is expected to be in the range of $1.05 billion to $1.15 billion as we continue to invest in our strategic initiatives and core business to support and drive future growth.
We also plan to repurchase a total of approximately $1.8 billion of our common stock this year, reflecting our strong liquidity position and confidence about the long-term growth opportunity for our business.
Despite approximately 8,400 lost store operating days as a result of closures due to winter weather across the country, same-store sales for the month of February increased 5.7%, reflecting a healthy comp sales increase of 11.2% on a two-year stack basis.
From the end of February through March 16, comp sales decreased approximately 16% as we are in the midst of lapping our most difficult monthly comp sales comparison of the year.
As a reminder, comp sales growth for the month of March in 2020 was 34.5%.
Also, please keep in mind that the second and third quarters represent the most challenging laps of the year from a gross profit rate perspective, following improvements of 167 basis points in Q2 2020 and 178 basis points in Q3 2020.
However, the leverage from these reduced costs is expected to be offset by deleverage associated with lower comp sales and approximately $60 million to $70 million in incremental year-over-year investments related to our strategic initiatives as we further their rollouts.
Finally, we estimate operating profit will be negatively impacted by approximately $35 million to $40 million in Q1 as a result of lost sales from storage closures and expenses related to the widespread winter weather that we experienced in February.
The NCI offering was available in more than 5,800 stores at the end of 2020, including nearly 400 stores in our light version.
This compares to our prior expectation of more than 5,600 stores at year-end.
Given our strong performance to-date, we plan to expand this offering to about 5,700 additional stores this year, bringing the total number of NCI stores to more than 11,000 by year-end.
This total includes over 2,100 stores in our light version, which incorporates a vast majority of the NCI assortment but through a more streamlined approach.
pOpshelf aims to engage customers by offering a fun, affordable and differentiated treasure hunt experience delivered through continually refreshed merchandise, a differentiated in-store experience and exceptional value with about 95% of our items priced at $5 or less.
In fact, we are now targeting to have a total of up to 50 pOpshelf stores opened by year-end compared to our previous goal of about 30 total locations.
In addition to these stores, we also plan to incorporate this concept in up to 25 Dollar General stores in 2021.
We are pleased with the success we are seeing on this front, driven by higher overall in-stock levels and the introduction of new products in select stores being serviced by DG Fresh.
And while produce is not included in our initial rollout plans, we believe DG Fresh provides a potential path forward to expanding our produce offering to more than 10,000 stores over time as we look to further capitalize on our extensive self-distribution capabilities.
In total, we were self-distributing to more than 16,000 stores from 10 facilities at the end of 2020.
This compares to our previous expectation of over 14,000 stores at year-end.
During 2020, we added more than 62,000 cooler doors across our store base.
In total, we expect to install more than 65,000 cooler doors in 2021 as we continue to build on our multiyear track record for growth in cooler doors and associated sales.
This convenient customer package pickup and dropoff service is now available in over 8,500 stores, with plans to be in a total of over 9,500 stores by year-end, further advancing our long track record of serving rural communities.
With regards to our supply chain, our plans for 2021 include further expansion of our private fleet, which accounted for more than 20% of our outbound fleet at the end of 2020.
In 2020, we completed a total of 2,780 real estate projects, including 1,000 new stores, 1,670 remodels and 110 relocations.
Additionally, we now have produce in more than 1,100 stores.
For 2021, we expect to open 1,050 new stores, remodel 1,750 stores and relocate 100 stores, representing 2,900 real estate projects in total.
We also plan to add produce in approximately 700 stores, bringing the total number of stores that carry produce to more than 1,800.
With about 8,500 square feet of selling space, both our first new format and DGP concept allow for expanded higher capacity cooler counts, an extended queue line and a broader product assortment, including NCI, a larger health and beauty section and produce in select stores.
In total, we expect more than 550 of our overall real estate projects this year to be in one of these format types as we look to further enhance our value and convenience proposition, particularly in rural America.
The second new format consists of about 9,500 square feet of selling space.
In addition to an extended queue line and broader assortment, this larger layout also includes nearly 50 high-capacity coolers and expanded produce offering, fresh meat and additional checkout lanes, including a self-checkout bullpen with multiple stations.
We believe this even larger format better positions us to meet the growing needs of our customers, particularly in highly underserved markets, and we are targeting more than 100 locations by year-end.
Through a combination of our growing relevance with customers, format innovation, an evolving retail landscape and leveraging new technologies, we estimate there are now approximately 13,000 additional small-box store opportunities in the Continental U.S. which are available for a Dollar General store.
This compares to our prior estimate of nearly 12,000 opportunities and is inclusive of our 2021 new unit pipeline.
And while we continue to evaluate, we currently estimate pOpshelf could add approximately 3,000 additional store opportunities in the Continental U.S., with about another 1,000 additional opportunities available for our smaller footprint DGX format.
When taken together, we estimate there are a total of approximately 17,000 new store opportunities available across our format types which we believe represents a long runway for new unit growth.
We made significant progress in 2020, highlighted by the accelerated rollout of DG Pickup, our Buy Online Pick Up In-store offering to more than 17,000 stores providing another convenient access point for those seeking a more contactless shopping experience.
mobile checkout and our mobile app, which ended the year with nearly 4 million monthly active users.
Self-checkout was available in more than 1,600 stores at the end of 2020, with plans for an aggressive expansion as we move ahead.
In fact, more than 12,000 of our current store managers are internal promotes, and we continue to innovate on the development opportunities we can offer our teams, including continued expansion of our private fleet and those associated with DG Fresh as well as pOpshelf.
In addition, we transitioned to a virtual learning environment in 2020, resulting in the continued development of our people, including nearly 3 million training hours for our employees, all supported by our award-winning training and development programs.

Summary:
In total, fourth quarter net sales increased 17.6% to $8.4 billion, primarily driven by comp sales growth of 12.7%.
Once again, this quarter, we increased our market share in highly consumable product sales, as measured by syndicated data, driven by a meaningful increase in both units and dollars.
We're particularly pleased that we delivered significant operating margin expansion, which contributed the fourth quarter diluted earnings per share of $2.62, an increase of 24.8% over the prior year.
Finally, as Todd noted earlier, earnings per share for the fourth quarter increased 24.8% to $2.62, which contributed to full year earnings per share of $10.62, an increase of 59.9%.
Merchandise inventories were $5.2 billion at the end of the year, an increase of 12.2% overall and 6.3% on a per-store basis.
With this in mind, we currently expect the following for 2021: net sales in the range of a 2% decline to flat; a same-store sales decline of 4% to 6% but which reflects growth of approximately 10% to 12% on a two-year stack basis; and earnings per share in the range of $8.80 to $9.50, which reflects a compound annual growth rate between 15% and 20% or between 14% and 19% on an adjusted basis over a two-year period, which is well above our long-term goal of delivering at least 10% annual earnings per share growth on an adjusted basis.
Capital spending is expected to be in the range of $1.05 billion to $1.15 billion as we continue to invest in our strategic initiatives and core business to support and drive future growth.
We also plan to repurchase a total of approximately $1.8 billion of our common stock this year, reflecting our strong liquidity position and confidence about the long-term growth opportunity for our business.
Despite approximately 8,400 lost store operating days as a result of closures due to winter weather across the country, same-store sales for the month of February increased 5.7%, reflecting a healthy comp sales increase of 11.2% on a two-year stack basis.
From the end of February through March 16, comp sales decreased approximately 16% as we are in the midst of lapping our most difficult monthly comp sales comparison of the year.
We are pleased with the success we are seeing on this front, driven by higher overall in-stock levels and the introduction of new products in select stores being serviced by DG Fresh.
For 2021, we expect to open 1,050 new stores, remodel 1,750 stores and relocate 100 stores, representing 2,900 real estate projects in total.