Excel intermediate lookup last-value data-analysis

How to Find the Last Non-Empty Value in a Column?

Last Value in Column is a Excel function that retrieves the last non-empty value from a specified column in excel.. Formula Genius generates and validates this formula automatically from a plain-English prompt.

If you're dealing with a column that keeps getting new data, this formula helps you quickly find the last non-empty entry.

The Formula

Prompt

"Get the last non-empty value in a column that is continuously being populated with new data"

Excel
=LOOKUP(2,1/(A:A<>""),A:A)

This formula retrieves the last non-empty value from a specified column in Excel.

Step-by-Step Breakdown

  1. The LOOKUP function searches for a value in a range.
  2. The expression 2,1/(A:A<>"") generates an array of 1s and errors for non-empty cells.
  3. LOOKUP finds the last 1 in this array, which corresponds to the last non-empty cell.
  4. The final argument A:A specifies the range from which to return the last value.

Edge Cases & Warnings

  • The column is completely empty, resulting in an error.
  • The last cell in the column is empty, causing the formula to return the previous non-empty cell.
  • The column contains only formulas that return empty strings, which may lead to unexpected results.

Examples

Prompt

"Column A: {"apple", "banana", "", "", "cherry"}"

Excel
"cherry"
Prompt

"Column A: {"", "", "", "", "", "grape"}"

Excel
"grape"

Frequently Asked Questions

What if my column has blank cells?

The formula will skip blank cells and return the last non-empty value.

Can I use this formula for multiple columns?

You need to adjust the range in the formula for each specific column.

What happens if the column is entirely empty?

The formula will return an error since there are no values to retrieve.

Can't find what you need?

Describe any formula in plain English and Formula Genius will generate, explain, and validate it — instantly.