Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Calculating the Day of the Year.
Written by Allen Wyatt (last updated September 23, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021
You've probably seen it on calendars before—some include an indication that "Today is the 123 day of the year with 242 remaining." You can easily calculate the day number of a year, as well as how many are remaining. For instance, let's assume you have a date in cell D27. You could use the following formulas to calculate, respectively, what day of the year it is and how many are still left:
=TRUNC(D27)-DATE(YEAR(D27)-1,12,31) =DATE(YEAR(D27),12,31)-TRUNC(D27)
Using these formulas, the result of 1/1/2023 in cell D27 would be 1 and 364, respectively, meaning it is the first day of the year. (This is as it should be.)
Of course, once you enter the formulas, you need to format the cells as regular numbers. (Excel will, by default, try to format the cells as dates.) With the two cells selected, follow these steps:
Figure 1. The Number tab of the Format Cells dialog box.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8727) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Calculating the Day of the Year.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
The VLOOKUP function, like other lookup functions in Excel, is not case sensitive. In other words, it doesn't matter ...
Discover MoreEver want the IF function to only return a value if the condition it is testing is true, and not if the condition is ...
Discover MoreWhen working with finances, you often need to know the rate of return on a given investment. The most common type of ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments