🛠️ UtilitiesFree Plan

RETURN_CELL_INVERSED

Return a cell by position counting from the end of non-empty values.

Firma de la Fórmula
=RETURN_CELL_INVERSED(range, inverseIndex)

Devuelve: any

Descripción General

RETURN_CELL_INVERSED retrieves a value from a range by counting positions from the end rather than the beginning. Position 1 returns the last non-empty cell (equivalent to RETURN_LAST_CELL), position 2 returns the second-to-last, position 3 the third-to-last, and so on.

Parámetros

ParámetroTipoRequeridoDescripción
rangeRangeThe range to search (e.g., A1:A100 or A:A).
inverseIndexnumberPosition from the end: 1 = last, 2 = second-to-last, etc.

Ejemplos

1

Get yesterday's value from a daily log

Retrieve the second-to-last value from a daily metrics column to compare with today's entry.

fx
=RETURN_CELL_INVERSED(B2:B100, 2)

Entrada

1200
1350
1400
1520

Salida

1400
2

Get value from 7 days ago

Retrieve the value from 7 entries ago for week-over-week comparison (position 8 = current + 7 prior).

fx
=RETURN_CELL_INVERSED(C2:C200, 8)

Entrada

100
105
98
110
115
108
120
125

Salida

100
3

Previous month's total

In a monthly totals column, get last month's value for comparison with the current month.

fx
=RETURN_CELL_INVERSED(D2:D50, 2)

Entrada

$45,000
$48,000
$52,000

Salida

$48,000
4

Third most recent entry

Get the third-to-last non-empty value from a growing list.

fx
=RETURN_CELL_INVERSED(A1:A20, 3)

Entrada

Alpha
Beta
Gamma
Delta
Epsilon

Salida

Gamma

Casos de Uso

Business Analytics

Period-over-period comparison

Access the previous period value to calculate growth rate or change percentage against the current period.

Finance

Rolling average calculation

Retrieve the last N data points to compute rolling averages for stock prices or revenue trends.

Customer Support

Recent activity display

Show the last 3-5 support tickets or interactions on a customer dashboard by accessing recent positions.

Healthcare

Previous reading comparison

Compare a patient's current vital reading with their previous reading to detect significant changes.

Software Development

Version history access

Access previous build numbers or version entries from an append-only deployment log.

Manufacturing

Shift handover data

Display the previous shift's production count alongside the current shift for handover reporting.

Consejos Profesionales

CONSEJO

Use positions 1 and 2 together to calculate the change between the last two entries: =RETURN_CELL_INVERSED(B:B,1) - RETURN_CELL_INVERSED(B:B,2).

CONSEJO

Build a "last 5 values" display by using positions 1 through 5 across five cells.

CONSEJO

Pair with SPARKLINE to visualize recent trends from the last N data points.

CONSEJO

Use a cell reference for the index to create a slider-like interface for browsing historical values.

This function is invaluable when you need to access recent entries in a growing dataset without knowing the exact row number. While RETURN_LAST_CELL always gets the very last entry, RETURN_CELL_INVERSED gives you flexible access to any position from the end. This is perfect for comparing recent values, calculating period-over-period changes, or displaying a rolling window of the most recent data points.

The function first collects all non-empty values from the range, then indexes from the end. Empty cells are excluded from the count, so position 1 is always the last cell that actually contains data, regardless of any trailing blank rows.

Common applications include showing the previous day's value alongside today's for comparison, calculating week-over-week changes by accessing values at positions 1 and 8, building "last N entries" displays on dashboards, and retrieving historical checkpoints from append-only logs. If the specified position exceeds the number of non-empty cells in the range, the function returns an empty string.

Errores Comunes

Returns empty string when data exists

Causa: The inverseIndex is larger than the total number of non-empty cells in the range.

Solución: Check how many non-empty cells exist using COUNTA(range) and ensure your inverseIndex does not exceed that count.

Returns unexpected value

Causa: Hidden non-empty cells (containing spaces or invisible characters) are being counted as valid entries.

Solución: Clean the range by selecting trailing cells and pressing Delete. Check for cells that appear empty but contain spaces.

Error with inverseIndex of 0

Causa: Zero is not a valid position. Positions start at 1.

Solución: Use inverseIndex = 1 for the last cell. The minimum valid position is 1.

Preguntas Frecuentes

Position 1 returns the last non-empty cell in the range, which is identical to using RETURN_LAST_CELL. Position 2 returns the second-to-last, and so on.

No, empty cells are excluded before counting. The function only considers non-empty cells, so position 2 is always the second-to-last cell with actual data.

The function returns an empty string. For example, if there are only 5 non-empty cells and you request position 10, you get "".

Yes, subtract the previous value from the current: =RETURN_CELL_INVERSED(B:B, 1) - RETURN_CELL_INVERSED(B:B, 2) gives you the change between the last two entries.

Yes, the position should be a positive integer. Decimal values will be truncated to the integer part.

Yes, you can reference a cell containing the position number: =RETURN_CELL_INVERSED(A:A, E1). This lets you dynamically change which position from the end you are accessing.

Yes, the function flattens the range first, reading left-to-right, top-to-bottom, then counts from the end of all non-empty values.

Traditional approaches like INDEX(range, COUNTA(range) - N + 1) do not handle gaps in data correctly. RETURN_CELL_INVERSED excludes empty cells, giving you accurate positioning even with sparse data.

Funciones Relacionadas

Comienza a usar RETURN_CELL_INVERSED hoy

Instala Unlimited Sheets para obtener RETURN_CELL_INVERSED y 41 otras funciones poderosas en Google Sheets.