![]() ![]() How to subtract or add days to date in Excel There are a number of Excel functions suitable for this purpose, and which one you use depends on which unit you want to add or subtract. Now that you know how to subtract two dates, let's see how you can add or subtract days, months, or years to a given date. If you are looking to count the number of months or years between two dates, then the DATEDIF function is the only possible solution and you will find a few formula examples in the next article that will cover this function in full details. Wrapping up, when it comes to subtracting dates in Excel and you want to find out how many days are between two dates, it makes sense to go with the easiest and most obvious option - simply subtract one date directly from another. If you prefer to supply the dates directly in the formula, then enter each date using the DATE(year, month, day) function and then subtract one date from the other.įor instance, the following formula subtracts 1 from 2 and returns the difference of 5 days: Subtracting dates with Excel DATE function Like in the previous example, both formulas work fine when today's date is greater than the date you are subtracting from it, otherwise DATEDIF fails:Įxample 4. Just use the TODAY() function instead of date 1: To subtract a date from today's date, you can employ either of the above formulas. The syntax of the Excel DATEDIF function, however, does not allow the start date to be greater than the end date and therefore it returns an error.Įxample 3. When you subtract a more recent date () from an earlier date (), the subtraction operation returns a negative number (-5) exactly as it should. The following screenshot demonstrates that both calculations return identical results, except for row 4 where the DATEDIF function returns the #NUM! error. If the above formula looks too plain, you can achieve the same result in a guru-like way by using Excel's DATEDIF function: Subtract dates using Excel DATEDIF function ![]() So, you are actually subtracting two numbers, and an ordinary arithmetic operation works without a hitch:Įxample 2. Subtract one date from the other directlyĪs you probably know, Microsoft Excel stores each date as a unique serial numbers beginning with 1 that represents January 1, 1900. ![]() As is often the case in Excel, the same result can be achieved in several ways. Supposing you have two dates in cells A2 and B2, and now you want to subtract one date from the other to know how many days are between these dates. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |