How To Count The Number Of Months

Table of contents:

How To Count The Number Of Months
How To Count The Number Of Months

Video: How To Count The Number Of Months

Video: How To Count The Number Of Months
Video: Calculate the Number of Months Between 2 Dates in Excel 2024, November
Anonim

You can calculate the number of months that fits between two arbitrary dates using the Microsoft Excel spreadsheet editor. To do this, it has the necessary set of functions for converting dates to numeric values.

How to count the number of months
How to count the number of months

It is necessary

Microsoft Excel spreadsheet editor

Instructions

Step 1

Enter in the first cell (A1) the start date of the period, the duration of which in months you want to calculate, and press Enter. The date must be specified in a format that can be understood by the spreadsheet editor. If the default settings have not been changed in its settings, then, for example, the date July 11, 2011, written in the form of July 11, 2011, will be understood correctly by the editor.

Step 2

Enter the end date of the calculation period in the next cell (A2) and press Enter.

Step 3

Enter in the next cell (A3) an equal sign, and after it the following formula: (YEAR (A2) -YEAR (A1)) * 12 + MONTH (A2) -MONTH (A1) The equal sign is interpreted by the spreadsheet editor as an instruction to consider everything that it is followed by a formula, not a text. After you press the Enter key, the difference in months between the end and start dates will be calculated and displayed in the cell with the formula.

Step 4

If something was calculated incorrectly or the inscription #VALUE! Appears in the cell with the formula, then make sure that the dates are in the correct formats. Then select both date cells, right-click and select Format Cells from the context menu.

Step 5

Click on the "Date" line in the list on the left ("Number Formats") and select the format that matches the format you used when entering dates. Commit the format change of these two cells by clicking OK.

Step 6

Open again the dialog for changing the format of cells, but now for the cell containing the formula - right-click it and select "Format Cells".

Step 7

Click the General row in the Number Formats list and commit the change by clicking OK. After the formats are aligned with the data types in the cells, the date difference in months should be displayed correctly.

Step 8

In the described method, the difference in months is calculated with rounding up - any incomplete month, regardless of the date, is considered complete. That is, the ordinal numbers of days in the month of the start and end dates are not taken into account. You can supplement the formula and count the number of months rounded to the nearest whole number of months (both up and down). To do this, write an equal sign in the fourth cell, and after it the following formula: IF (DAY (A2)> = DAY (A1); 0; -1) + (YEAR (A2) -YEAR (A1)) * 12 + MONTH (A2) -MONTH (A1)

Recommended: