The symbol used for the subtraction formula is a minus sign “-” as well as a sign used in a mathematical operation. Subtraction Formula Using the Minus Sign “-“
If you have any questions, feel free to comment. There are also a lot more date functions outside of the ones I mentioned, so feel free to check those out also on the Office Support site. It’s a good idea to know both methods so that you can attack different problems with different formulas.Īs long as you are careful with which formulas you use, it’s fairly easy to calculate exactly what you are looking for. Since the difference in the number of days is only 802, DATEDIF shows 2 years whereas the YEAR function shows 3 years.Īgain, this is a matter of preference and depends on what exactly you are trying to calculate. One formula uses DATEDIF and the other uses the YEAR function. So let’s take our example where I have used two different formulas for calculating the number of years:
=DATEDIF(A2, A3, "M") Years Between Two DatesĪs with months, years can also be calculated depending on whether you want to count 1 year as a full 365 days or if a change in the year counts. Lastly, you can also use the DATEDIF function, but it only calculates full months, so in our case the answer it returns is 26. Round up gives me 27 months and round down gives me 26 months, which is accurate, depending on how you want to look at it. So what’s the final result of the two formulas on our current example? Let’s see below: In order to see the formula in the cell itself, click on the Formulas tab and then click Show Formulas. Note the you should edit the round down formula in the actual cell itself because for some odd reason the entire formula does not show up in the formula bar. Now these are two fairly long and complicated formulas and you really don’t need to understand what’s going on.
Microsoft has provided these here, but if you are too lazy to visit the link, I have provided them below also. Since that is kind of pointless, let’s look at some formulas that will get us the correct answer. This means it’s only useful for calculating the difference between two months in the same year. Now there is a MONTHS function in Excel, but it’s very limited because it will only look at the month when calculating the difference and not the year. The trickiest calculation is the number of months because of how you can either round up or round down depending on whether it’s a complete month or a partial month. Luckily, you can see the syntax and all supported arguments for the DATEDIF function here.Īs an added bonus, what if you wanted to calculate the number of weekdays between two dates? That’s easy enough also because we have a built-in formula: =NETWORKDAYS(startDate,endDate)Ĭalculating the number of days and weekdays is simple enough, so let’s talk about months now. When you type the formula, you’ll see that Excel does not give you any suggestions for the fields, etc. Lastly, you can use a function called DATEDIF, which is included in Excel from Lotus 1-2-3 days, but isn’t an officially supported formula in Excel. If you switch the dates in the formula, you’ll just get a negative number. This function takes two arguments: the end date and the start date. In addition, you can also use the DAYS function.
Excel knows it’s a date and simply calculates the number of days between those two dates. The first formula is just a simple subtraction of the two dates, A3 – A2.