Excel Formulas to Highlight Last N Rows with Conditional Formatting!!
Tags: excelformula, conditionalformattin, excelformulas
Published: 2021-03-15 11:48:46

---
title: Excel Formulas to Highlight Last N Rows with Conditional Formatting!!
published: true
date: 2021-03-15 11:47:31 UTC
tags: ExcelFormula,Conditionalformattin,Excelformulas
canonical_url: https://geekexcel.com/excel-formulas-highlight-last-n-rows-conditional-formatting/
---

Assume that you have a list of data, and you need to highlight the last row values based on a certain condition. How could you achieve this in Excel? In this tutorial, we will provide some useful formulas to **highlight the last N rows in Excel by using the conditional formatting** options. Let’s get them below!! Get an official version of ** MS Excel**  from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)

[![Highlight last N rows with conditional formatting](https://geekexcel.com/wp-content/uploads/2021/03/Highlight-last-N-rows-with-conditional-formatting.png)](https://geekexcel.com/excel-formulas-highlight-last-n-rows-conditional-formatting/highlight-last-n-rows-with-conditional-formatting/#main)<figcaption id="caption-attachment-22472">Highlight last N rows with conditional formatting</figcaption>
## General Formula:

- You can use the below formula to highlight the last N rows in Excel.

**=[ROW](https://geekexcel.com/row-function-in-microsoft-excel-365-how-to-use/)()-[INDEX](https://geekexcel.com/index-function-in-microsoft-excel-365-how-to-use/)(ROW(data),1,1)+1>ROWS(data)-N**

## Syntax Explanations:

- **ROW ** – The Excel **[ROW function](https://geekexcel.com/row-function-in-microsoft-excel-365-how-to-use/)** will help to return the row number for reference.
- **INDEX ** – The [**INDEX**   **function**](https://geekexcel.com/index-function-in-microsoft-excel-365-how-to-use/) ** ** returns the value at a given position in a range or array. INDEX is frequently used together with the **[MATCH](https://geekexcel.com/excel-formulas-to-find-position-of-nth-matching-value/)** function.
- **Data ** – It represents the input values in a worksheet.
- **N ** – It is the N number of rows that want to be highlighted.
- **Comma symbol (,)** – It is a separator that helps to separate a list of values.
- **Parenthesis ()** – The main purpose of this symbol is to group the elements.

## Practical Example:

Refer to the below example image.

- Here we will enter the input values in **Column B**. Now we need to highlight the last N row which is given in **Column D**.

![Input Ranges](https://geekexcel.com/wp-content/uploads/2021/03/Input-Ranges-17.png)<figcaption id="caption-attachment-22473">Input Ranges</figcaption>

- Apply the formula in the conditional formatting option.
- To know **how to apply conditional formatting** in Excel, just **refer to this article<u>:</u>[How to Apply the Formula with Conditional Formatting In Excel?](https://geekexcel.com/how-to-apply-formula-with-conditional-formatting/)**
- Finally, it will highlight the cell based on the given criteria.

![Result](https://geekexcel.com/wp-content/uploads/2021/03/Result-21.png)<figcaption id="caption-attachment-22470">Result</figcaption>

## Wrap-Up:

Here, we have described the simple methods used to **highlight the last N rows in Excel with the Conditional formatting option**. Please share your **query** below in the **comment** box. We will assist you. Thanks for visiting **[Geek Excel](https://geekexcel.com/)!!** To learn more, check out [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!!**

### Read Ahead:

- **[Highlight & Count a Specified Value using Macros in Excel 365!!](https://geekexcel.com/highlight-count-a-specified-value-using-macros-in-excel-365/)**
- **[Excel Formulas to Highlight 3 Smallest Values with Criteria!!](https://geekexcel.com/excel-formulas-to-highlight-3-smallest-values-with-criteria/)**