Get Date of Last Entry in Excel: Formula & Steps
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This article explains how to find the date associated with the last entry in a list, such as the most recent sale, login, or update. You will learn a simple Excel formula that returns the date from the last non-empty cell in a column, along with variations for different scenarios. The answer is: use the LOOKUP function with a large number to get the last date in a column, or combine INDEX and MATCH for more control.
Formula
The most direct formula to get the date of the last entry in a column (assuming dates are in column A, starting at A2) is:
=LOOKUP(2, 1/(A:A<>“”), A:A)
This works by creating an array of errors and 1s (1 where a cell is not empty, error where it is empty), then LOOKUP finds the last 1 and returns the corresponding date. For a specific range like A2:A100, use =LOOKUP(2, 1/(A2:A100<>“”), A2:A100).
If you need the date from the last entry that meets a condition (e.g., last entry for a specific product), use an array formula:
=MAX(IF(B2:B100=”Product A”, A2:A100)) (enter with Ctrl+Shift+Enter in older Excel, or just Enter in Excel 365).
Worked Example
Suppose column A has dates: A2 = 2024-01-15, A3 = 2024-02-20, A4 = 2024-03-10, A5 = empty. To get the last date (2024-03-10), use:
=LOOKUP(2, 1/(A2:A5<>“”), A2:A5)
Step-by-step: 1/(A2:A5<>“”) returns {1;1;1;#DIV/0!}. LOOKUP(2, …) finds the last value less than or equal to 2, which is the third 1, and returns the corresponding value from A2:A5, which is 2024-03-10.
When to Use This Formula
Use this formula when you need to track the most recent date in a log, such as the last time a client was contacted, the last inventory update, or the latest transaction. It is especially useful in dashboards where you want to display “Last updated” without manually scrolling. The formula works with any data type, not just dates, but it is most common for dates.
How to Read the Result
The result is a date serial number. Format the cell as a date to see it as “3/10/2024”. If you see a number like 45361, that is the serial number; just apply a date format. To show the date and time, use a custom format like “yyyy-mm-dd hh:mm”.
Common Mistakes and Fixes
- Trailing spaces or non-printing characters can make a cell appear empty but not be empty. Use =TRIM() to clean data.
- Blank cells within the range are fine; the formula skips them. But if there are zeros or text, they will be treated as entries.
- Using MAX with dates is simpler if you only have dates and no text, but MAX ignores text and returns the largest date. It will not work if there are blank cells with formulas that return “”.
- Array formulas require Ctrl+Shift+Enter in older Excel; forgetting this returns a #VALUE! error.
Alternatives to LOOKUP
If you prefer a more explicit approach, use =INDEX(A:A, MATCH(1E+306, A:A)). This finds the last cell with a number (dates are numbers) and returns its value. For text entries, use =LOOKUP(REPT(“z”,255), A:A) to get the last text entry. Another option is =MAXIFS(A:A, B:B, “Product A”) in Excel 2019 and later, which returns the latest date for a condition without array entry.
Frequently Asked Questions
How do I get the date of the last entry in a row instead of a column?
Use the same LOOKUP formula but with a row range, e.g., =LOOKUP(2, 1/(1:1<>“”), 1:1). This returns the last non-empty cell in row 1.
What if my data has blank cells in the middle?
The LOOKUP formula handles blanks correctly because it only looks at non-empty cells. It will return the last non-empty cell, regardless of blanks.
Can I get the last entry date for a specific category?
Yes, use =MAX(IF(B2:B100=”Category”, A2:A100)) as an array formula. In Excel 365, you can also use =MAXIFS(A2:A100, B2:B100, “Category”).
Why does my formula return 0 or a date like 1900?
This usually means the range contains no actual dates, or the cells are formatted as text. Check that your dates are real Excel dates (right-align by default) and not text. Use the DATEVALUE function to convert text dates.
How do I get the last entry date and time together?
If your timestamps are in one column, the same formula works. Just format the result as “yyyy-mm-dd hh:mm”. If date and time are in separate columns, combine them with =date + time.