How to Calculate Days with Aging Formula in Excel: 2 Practical Cases

Case 1 – Calculate Days Between Specific Dates

Let’s say we have a sample dataset of names of some customers who have ordered some products from a shop, the order date, and the delivery date. We want to calculate the days taken to deliver the products to the customers.

Dataset to calculate days with aging formula in excel


Method 1 – Subtracting Days

Steps:

  • Create a new column for the results.
  • Select the first cell in that column and apply the following formula:

=D5-C5

  • Press Enter.

Subtracting to calculate Days with aging Formula in Excel

  • Drag the Fill Handle tool to Autofill the formula down to the next cells and all the cells will calculate the days taken for delivery and return the results.


Method 2 – Calculate Using DAYS Function

The DAYS function returns the number of days between two specific days.

Steps:

  • Select a cell and type the following formula into the selected cell:

=DAYS(D5,C5)

DAYS function to calculate Days with Aging Formula in Excel in

  • Press Enter and drag the formula to the next cells to copy the formula and calculate the days.


Method 3 – Using DAYS360 Function

The DAYS360 function can better approximate fiscal months.

Steps:

  • Select E5 and type the following formula:

=DAYS360(C5,D5)

DAYS360 function to calculate days with Aging Formula in Excel

  • Press Enter and drag the formula down to get the output for all cells.

This function calculates days on the basis of 30 days/month. If you try to calculate the difference between the 1st and 31st day, it will show a little error and then return 30.

Method 4 – Applying DATEDIF Function

Steps:

  • Type the following formula in E5:

=DATEDIF(C5,D5,"D")

DAYS360 function to Calculate Days with Aging Formula in Excel

  • Press Enter and the cell will return the result.
  • Drag the formula down and all the cells will calculate the days between the two dates and return you the output.

Note: After applying the function, the cell may show the result in date format. In this case, you need to change the format of the value.

Method 5 – With YEARFRAC Function

Steps:

  • Select E5 and copy the following formula:

=YEARFRAC(C5,D5,3)*365

  • Press Enter to let the cell show the result.

 💡 Formula Breakdown

YEARFRAC(C5,D5,3) returns the actual year considering 365 days as the basis is used 3 (365 day count basis).

Output=> 0.0356164383561644

YEARFRAC(C5,D5,3)*365 = 0.0356164383561644*365 will convert the year into days.

So, final Output=> 13

Note: After applying the function, the cell may show the result in date format. In this case, you need to change the format of the value.
  • Drag the formula down and all the cells will return the result.

YEARFRAC Function to Calculate Days with Aging Formula in Excel


Case 2 – Aging Formula to Calculate Days from Current Date

Another case for calculating days is when one date is specified and another date is the current date. The scenario from the sample would be like the following screenshot, so we’ll remove the D column and use it for the results.


Method 1 – Applying TODAY Function

 

Steps:

  • Select D5 and type the following formula into the cell.

=TODAY()-C5

  • Since TODAY function returns the current date, subtracting the specified date from this function results in the difference between them.

Screenshot was taken on Sept 28, 2022, which was the result of the TODAY() function.


Method 2 – Combining YEARFRAC and TODAY Functions

  • Use the following formula in D5:

=YEARFRAC(C5,TODAY(),3)*365

Combining YEARFRAC & TODAY Function to Calculate Days in Excel

Screenshot was taken on Sept 28, 2022, which was the result of the TODAY() function.

 💡 Formula Breakdown

TODAY() function returns the date of today. Sept 28, 2022 for the time of writing.

YEARFRAC(C5,TODAY(),3) returns the actual year considering 365 days as the basis is used 3 (365-day count basis).

YEARFRAC(C5,TODAY(),3)*365 will convert the year into days.

So, final Output=> 26


Things to Remember

  • Change the format of the cell after applying the formula if the cell shows the result in date format.

Download Practice Workbook

You can download the practice book from the link below.


<< Go Back to Ageing | Formula List | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Rafiul Hasan
Rafiul Hasan

Rafiul Hasan, holding a BSc in Naval Architecture and Marine Engineering from Bangladesh University of Engineering & Technology, contributes significantly to the ExcelDemy project with almost 1.6 years of dedicated work. Currently an Excel and VBA Content Developer, he has a passion for problem-solving. Authoring over 100 articles for ExcelDemy showcases expertise in Microsoft Office Suites and Data Analysis. In addition to content development, Rafiul actively engages with the ExcelDemy forum, offering valuable solutions to user queries and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo