DAYS function, how to use the function to calculate the number of days between two time points in Excel
Excel functions are many and divided into categories based on their functions such as database functions, information functions, technical functions, etc. In which there will be 10 functions that we often use in Excel. such as the SUM function in Excel, the IF function or the DAYS function.
DAYS function belongs to the date function group, used to return results between 2 time points. With DAYS function, the calculation of the time interval will be much easier, can be applied to many different cases. The following article will show you how to use DAYS function in Excel.
- How to separate the date, month, and year columns into 3 different columns in Excel
- Instructions on how to insert the current date in Excel
- How to calculate the number of days in Excel
- Calculation of age in Excel
Instructions for using DAYS function in Excel
DAYS function in Excel has a syntax to use = DAYS (end_date, start_date) .
Inside:
- end_date: the end date to determine the number of days, is a required parameter.
- start_date: the first day you want to specify the number of days, is a required parameter.
Note when using DAYS function:
- If end_date and start_date are all numeric, the function uses EndDate - StartDate to calculate the number of days between these two dates.
- If one of the two end_date and start_date values is textual, the function automatically switches to the date format using the DATEVALUE (date_text) function and then calculates.
- If end_date and start_date are outside the scope of valid dates, the function returns the #NUM! Error value.
- If the text argument cannot be converted to a valid date format, the function returns the #VALUE! Error value.
Example 1: Calculate the time gap
We have the following time table with different timelines and formats.
In the first cell enter the result of the distance calculation, we enter the formula = DAYS (B12, A12) and press Enter.
As a result, we have a time gap between two different timelines. You drag the first result box down the remaining cells of the table.
Example 2: Calculate the number of years the employee works
To calculate the number of working years for employees, users must use DAYS function to calculate the working time and then divide it by 365 to get the number of years of work.
Step 1:
In the first year of work, enter the formula = DAYS (E2, D2) / 365 and press Enter.
Step 2:
When displaying the first result, scroll down to the remaining cells.
Note if the result does not show the number of years, right-click and choose Format Cells. Then we select the Number format. If the result displays a decimal, remove the product in Use 1000 Separator and enter the number 0 in the Decimal palces to show the integer value for the number of years.
In the case of a retired person, we must enter another formula to calculate the number of years of service until the current time of entering data.
In the input box, enter the formula = DAYS (TODAY (), D8) / 365 and press Enter. In which cell D8 will be the time to start calculating seniority until the current year.
Results show and calculate the number of years of service until the current year. Scroll down to the other cell to show the result.
Above are some examples of DAYS functions in Excel. Usually the DAYS function will be combined with other functions such as TODAY, for example, to calculate a certain time period.
I wish you all success!
You should read it
- Basic Excel functions that anyone must know
- MS Excel 2007 - Lesson 6: Calculation in Excel
- How to use the kernel function (PRODUCT function) in Excel
- How to use SUMPRODUCT function in Excel
- DAYS360 function - The function returns the number of days between 2 dates, based on 360 days in Excel
- How to use the MOD function and QUOTIENT function in Excel
- SUM function in Excel: How to use SUM to calculate totals in Excel - SUM function in Excel
- How to add computers to Excel
May be interested
- Round a number in Excel (ROUND function)instructions on how to round numbers in excel, help calculate faster depending on how to round the number of digits after and before the comma, there are many number rounded functions in excel. 1. round a number using the round () function - meaning: rounds to the nearest number
- SUM function in Excel: How to use SUM to calculate totals in Excel - SUM function in Excelthe sum function in excel is quite commonly used. below are details on how to calculate the sum function and related issues in microsoft 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.
- NPER function - The function calculates the period number of an investment in Excelcalculating interest rates for securities are usually calculated by period. so if you are a stock player, please know this calculation offline to be able to actively calculate the interest received. the following article shows how to use the nper function to calculate the number of periods for an investment.
- How to calculate time in Excel: Add and subtract timeexcel can calculate the amount of time by adding / subtracting method to give you the result of the amount of time in minutes, hours, days, and months. the following software tips will guide you the most basic formulas. the problem is that you have time to complete two steps of work, and you want to know how many hours and minutes it will take to complete the job.
- DATEDIF function - The function calculates the number of days, months, years between 2 dates in Exceldatedif function: the function performs the calculation of number of days, months, years between 2 dates in excel. functions are useful in formulas for calculating age numbers. syntax: datedif (start_date, end_date, unit)
- How to use DSUM function in Excelthe dsum function on excel is used to calculate the conditional sum in a field, or column in the data list.
- How to use the Power function in Excelthe power function in excel is a power function with a given number that you don't need to calculate manually.
- 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.
- NETWORKDAYS function - The function returns the number of whole working days between 2 dates in Excelnetworkdays function: the function returns the number of intact working days calculated between two specific dates. working days do not include weekends and holidays specified. syntax: networkdays (start_date, end_date, [holidays])