How to subtract dates, months, and years in Excel - Calculate the distance between two dates in Excel
In the process of processing data in Excel you need to subtract days, months and years in Excel. You do not know how to calculate and use what function? So invite you and TipsMake.com to learn how to calculate the distance between two dates in Excel, except for days, months and years in Excel below.
Here TipsMake.com has shared with you how to subtract days, months and years in Excel, please follow along.
Calculate the distance between two dates in Excel
Subtract the direct date
Assuming that in cell A1 is the start date, B1 is the end date, then you can subtract the date directly by entering the formula = B1-A1 the result will be the number of days. Because in Microsoft Excel stores every day as a unique serial number starting with 1 representing 1 January 1900.
Subtract dates using the DATEDIF function
Another way to help you subtract dates is to use the DATEDIF function with the syntax:
= DATEDIF (start date, end date, "d")
Note: the end date must be greater than the start date otherwise the function will error.
Subtract dates using the DATE function
Using the DATE function is a bit more complicated, the formula for the DATE function is as follows:
= DATE (year1, month1, day 1) -DATE (year, month, day)
Example subtracting date: May 22, 2019 for May 13, 2019.
Subtract the date from the current date
To subtract dates from the current date to the date in cell A1 , you use TODAY () instead of the current date, and you can also subtract directly with the formula:
= TODAY () - A1
Note: you need to format the cell containing the formula = TODAY () - A1 is Number .
Or you can use the DATEDIF function as follows:
= DATEDIF (A1, TODAY (), "d")
Distances are in weeks
Calculate the distance in weeks, you use the DATEDIF function with the following syntax:
= DATEDIF (start date, end date, "d") / 7
The distance in months
Calculate the distance in months using the DATEDIF function with the following syntax:
= DATEDIF (start date, end date, "m")
For example:
The distance in years
Use the DATEDIF function to calculate the distance in years with the syntax:
= DATEDIF (start date, end date, "y")
For example:
So, here TipsMake.com shared with you how to calculate the distance between two dates in Excel, calculate the distance in weeks, months and years. Hope you will understand and apply the calculation accordingly. Good luck!
You should read it
- Wings calculates the number of days, the difference between two dates in Excel
- How to sort dates in ascending and descending ways in Excel
- Instructions on how to fix reverse dates in Excel
- How to calculate time in Excel: Add and subtract time
- Format dates in Excel
- Share how to fix dates being converted to numbers in Excel
- How to convert numbers to dates in Excel
- Instructions on how to insert the current date in Excel
May be interested
- How to Subtract in Excelthis wikihow teaches you how to subtract the contents of one or more excel cells from another cell. open excel. it's a green app with a white 'x' on it.
- Date functions in Excel, DAY, WEEKDAY, MONTHdo you want to automatically update the current date, separate years or calculate the distance between two time points? the article below, free download will guide you how to do this professionally with date functions in excel.
- DATEDIF () function (calculate the total number of years, total months or total days from two given periods) in Excelthe datedif () function helps you calculate the total number of years, the total number of months, or the total number of days from two given periods.
- How to use functions to identify and calculate date information in Excelthe following article details how to use functions in excel 2013 and 2016 to identify and calculate date information. to use the functions related to date information, let's explore the following: 1. the relationship between excel and dates is nothing special. first.
- The easiest way to calculate the percentage (%)calculating percentages on excel doesn't have to use excel functions, it's just a normal calculation. so how to calculate the fastest percentage, and also need the most accurate. the following article will guide you how to calculate the most accurate percentage value.
- DAYS360 function - The function returns the number of days between 2 dates, based on 360 days in Exceldays360 function: the function performs the calculation of the number of days between 2 days, based on 360 days year (from 12 months, 30 days per month). useful function in calculating payments in the accounting system based on twelve months 30 days. syntax: days (start_date, end_date, [m
- How to sort dates in ascending and descending ways in Excelhow to sort dates in ascending and descending ways in excel. the following article helps you to sort dates in ascending or descending order in excel quickly and effectively. method 1: step 1: select the data column containing dates to sort - on the data tab
- Instructions on how to fix reverse dates in Excelwhen we install the english language on microsoft excel, you will have an english date error, the previous month and then the date and year. so how can i return to the correct format of day, month and year in excel?
- 3 ways to calculate totals in Excelto calculate totals on excel, users can use them in three different ways, based on spreadsheets, autosum functions or sum functions with large data areas.
- DAYS function, how to use the function to calculate the number of days between two time points in Excelthe days function in excel returns the results between two different timelines.