Compare dates in Excel

Author: Frank Hunt
Date Of Creation: 14 March 2021
Update Date: 1 July 2024
Anonim
How to Calculate the Difference Between Two Dates​ in Excel
Video: How to Calculate the Difference Between Two Dates​ in Excel

Content

This wikiHow teaches you how to find out which dates are before or after a specific date in Microsoft Excel.

To step

  1. Open the spreadsheet containing the date. Double-click the file on your computer, or open Microsoft Excel (in the map Programs on a Mac, or All programs in the Start menu on a PC) and select the spreadsheet.
    • Use this method to see which dates in a column come earlier or later than a specified date.
  2. Click on an empty cell. Use a standalone cell as it is only to enter the date to be compared.
  3. Type the date you want to compare other dates with.
    • For example, if you want to know which dates in column B will be before January 1, 2018, you can 01-01-2018 in the cell.
  4. Click an empty cell parallel to the first date in the column.
    • For example, if the dates you want to check are in B2 through B10, click an empty cell in row 2 (after the last column).
  5. Paste the IF formula into the cell and press ↵ Enter. In this example, the first date in the list is in B2, and the test date in G2:
    • = IF (B2> $ G $ 2, "YES", "NO").
    • If the date in B2 comes after the date in G2, the word YES appears in the cell.
    • If the date in B2 precedes the date in G2, the word NO appears in the cell.
  6. Click the cell containing the formula. This selects the cell.
  7. Drag the bottom right cell down to the last row of the sheet. This will fill each cell in the column (G, in our example) with the formula, which compares each date in the column (B, in our example) to the date you want to compare.