With Microsoft Excel, it is very easy to compare (anteriority or posterity) dates with a given date.
Steps

Step 1. Open the spreadsheet that contains your dates
To do this, either you double click on the file and it is executed. Otherwise, first run Excel from the menu To start up, then All applications (Windows), or from the folder Applications (macOS) and you run the dates file.
This method is used to compare (prior or after) dates in separate cells

Step 2. Click on an empty cell
Choose a cell (which will receive the comparison date) away from the data already typed.

Step 3. Type the date you want to compare to other dates
- You wanted to know which dates in column B are before 1er January 2018: then type in the 2018-01-01 cell.

Step 4. Click on an empty cell
You take whatever you want.
So you have dates in all the cells that go from B1 to B6, click on the empty cell that is just under the references date, another empty cell would have done the trick

Step 5. Paste the comparison formula
It begins with the IF attribute and continues in parentheses with the comparison operation, then the responses to be provided depending on the result. Once done, validate with the Enter key. In our example, the first date to compare is in cell B2, and the comparison date in G4.
- Here, the formula is: = IF (B2> $ G $ 4, "YES", "NO").
- If the date contained in B2 is later than that of G2, YES is displayed in the cell.
- If the date contained in B2 is earlier than that of G2, NO is displayed in the cell.

Step 6. Click on the cell that contains the formula
The cell is thus selected.

Step 7. Expand the cell that contains the formula
In order to have an answer for each of the dates, click in the lower right corner of the cell with the formula, keep the mouse button pressed, then drag the cell down as many cells as there are dates to compare. These cells then contain the formula and make the comparison.