In this article, we will learn about how to get to the nth day of year in Excel. It is like getting serial number of a date in its year.
Let's say we have a date. Now we need to find out what day of the year it is. To get the date of year in excel we will make a formula using the DATE & YEAR function. We will use the serial number attribute of date value in Excel. We will get the last date of the previous year and subtract the result form the given date value.
date : given date value
All the above explained procedures might be confusing. So clear all the doubts via the example shown below.
Here we have some random data values and we need to find the nth day of year from the date value.
Use the formula:
Use the above function formulas to get the days between dates in Excel.
As you can see, the formula works fine as it returns 228 as a result. Now use drag drop down till the dataset dates.
Here are the days from the date of the year calculated using the formula.
We can calculate the same result using one more logic. If we subtract the given date value from the first date of the same year and add 1 ( +1 ).
You can use any of the formulas as both return the same result.
Note: DO NOT give the data argument directly to the formula as the Excel formula doesn't necessarily understand the date value and returns error. Provide the date argument using the DATE function or using the cell reference option.
Hope you understood how to Get nth day from date of year in Excel. Explore more articles on Excel Date & TIME functions here. Please feel free to state your query or feedback for the above article.
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.