Automating Excel Spreadsheet Report Titles
By David H. Ringstrom, CPA
Many users tire of retyping report titles such as "For the Period Ended October 31, 2012" month after month. Further, if you're like me, sometimes printing the report reminds you that the title needs updating. I'll explain a couple of techniques you can use to simplify, and even automate, such date-based report titles.
Let's first assume that each month you'll enter a date, such as 10/31/12, into cell A1. We can transform this into "For the Period Ended October 31, 2012" with a simple formatting trick. In Excel 2007 and later, click the Format Cells: Number button on the Home tab, as shown in Figure 1. This displays the Format Cells dialog box shown in Figure 2. (In Excel 2003 and earlier, choose Format, and then Cells.)
Figure 1: The Format Cells: Number button displays the Format Cells dialog box.
Within the Number tab of the Format Cells dialog box, choose Custom, and then enter the following text in the Type field:
"For the Period Ended" mmmm d, yyyy
Figure 2: A custom number format can transform a date like 10/31/12 into a report title.
Be sure to place double quotes before For, after Ended, and include a space before mmmm. The four m's within the format signify that we wish to convert a numeric month to its equivalent month name. The d displays the day portion, the date that we input in cell A1, and yyyy presents a four digit year. Although I could use mmmm d, yyyy on its own as a custom format to spell a date out in long form, in this case, I enclosed additional text in quotes. Going forward, you can simply type a new date in mm/dd/yy format and the title will update automatically.
Figure 3: The report date can be updated by typing a new date in cell A1 in mm/dd/yy format.
Assuming that your report dates are always the last date of the previous month, you can completely automate your report title with a simple formula. To do so, we'll use the DATE function, along with the YEAR, MONTH, and NOW functions.
The DATE function has three inputs: year, month, and day. The YEAR and MONTH functions each accept a date as their only reference. The NOW function returns today's date, and so use these functions together as shown in Figure 4:
To break the formula down, I placed the NOW() function inside the YEAR and MONTH functions, respectively. This gives me the year and month for today's date. Although I could use Excel's DAY function to extract the day portion of a date, in this case, I used a zero instead. Doing so instructs Excel to return the last day of the preceding month. Couple this formula with the aforementioned custom number format, and you'll never need to update that report title again.
Figure 4: The combination of the DATE function and a custom number format automates your report title.
See all articles by David Ringstrom.
About the author:
David H. Ringstrom, CPA heads up Accounting Advisors, Inc., an Atlanta-based software and database consulting firm providing training and consulting services nationwide. Contact David at email@example.com or follow him on Twitter. David also presents monthly Excel webcasts for AccountingWEB partner CPE Link.
Voice of the Editor
Results from a recent AICPA survey disclosed the two top priorities for CPA firms as they plan for the future: bringing in new business and finding talent. Our goal at Sift Media is to help our readers deal with the issues most important to them. One way in which we are doing this is through the launch of our new recruitment/placement service, Going Concern Jobs. Check it out today for your talent needs.
This Week on AccountingWEB
Plante Moran CPAs Gordon Krater, Alicia Sturtevant, and Susan Perline spoke with AccountingWEB about the firm's Women in Leadership initiative.
Jeff Thomson, CMA, president and CEO of the IMA, talks with us about the 2013 jobs market for accounting professionals.
Todd Lisle of BKD LLP and Amy Welch of OSCPA share their stories of helping tornado victims in Moore, Oklahoma.
Ted Dickman, CEO of BKD LLP and chairman of the board of directors for the Indianapolis 500 Festival, offers tips on encouraging employees to become involved in their communities.