Excel every second row

In this post I will show you how to select every other row in Excel. Like many tasks in Excel, there is more than one way to achieve this. Here I show you 5 ways to select every other row in Excel. These 5 tips will improve your data manipulation skills.

Use the contents table below to skip to each section.

  1. Using CTRL and mouse click
  2. Conditional Formatting
  3. Format Data as a Table
  4. ‘Go To Special’ hack
  5. VBA (automation)

Using CTRL and Mouse Click To Select Every Other Row

The simplest way to select every other row in Excel is to hold down down the CTRL button on your keyboard (⌘ on MAC) and then the number of the rows you want to select.

Clicking on the row number itself highlights the whole row. By holding down CTRL, we are able to select every other row or even a bunch of single cells. This sort of selection is referred to as a non-contiguous range.

Screenshot showing how to select every other row in excel using the CRTL and mouse click method

To deselect a row, simply click on it again. You can also perform a non-contiguous selection on individual cells and columns.

The advantage of this technique is it’s speed. You can very quickly select the rows you want to alter and then apply the change to all of them in one go.

The downside to this technique is when you have large datasets and it becomes too laborious to select all the rows you want manually.

You can also see from our example that the row selection exceeds the boundaries of our data which is also something you may not want to do.

Highlight Every Other Row With Conditional Formatting

Conditional formatting alters the look of a cell based upon the value within it. It is a very flexible tool and we can use it to highlight every other row in a data set. We can use it to highlight (select) every other row in Excel.

In this example, I want to color alternate rows, starting with the first row after the header.

First I select the data I want to apply the Conditional Formatting to (excluding the header), then hit:

Home –> Conditional Formatting –> New Rule…

select every other row in excel - conditional formatting 01

Doing this will bring up the New Formatting Rule dialog box. From the options available, click on ‘Use a formula to determine which cells to format’.

This will change the dialog box to allow you to enter a formula that your conditional formatting will abide by. In the box, insert the following formula:

=MOD(ROW(B2),2)=0

NOTE: Substitute B2 above for the top-left most cell in your selection.

select every other row in excel - conditional formatting 02

Formula Explainer

The MOD function returns the remainder of a division expression. So if you passed in the number 3 to be divided by 2, you’d get 1.

The ROW function returns the number of the row of the cell reference that you pass in. So in this case, cell B2 is row number 2.

So by passing in the row number, and dividing it by 2 using the MOD function, we’ll be able to tell if a row number is odd or even. Odd row numbers will return 1, even row numbers will return 0.

When the formula evaluates to 0, our conditional formatting rule is applied!

Next you can set the color of that you’d like the alternate rows to be. To do this, simply click ‘Format…’ –> Fill and select your chosen color. Then hit OK.

select every other row in excel - conditional formatting 03

Click OK again to exit out of the Conditional Formatting rules dialog box and your rule will be applied immediately to your selection.

select every other row in excel - conditional formatting 04

Format Data As A Table

Excel has a built-in feature to format ranges as tables. There are many advantages to using tables in Excel and you can learn more about using them from this great post by Easy Excel on Data Tables In Excel.

One of those benefits is that the data is formatted nicely with alternate colored rows, making it simpler for us to eye over the data.

To convert a range to a data table, first select the data, including a header if you have one, and then click:

select every other row in excel - format data as a table 01

Keyboard Shortcut

To quickly insert a table, select your data, then press CTRL + T on the keyboard.

The ‘Create Table’ dialog box will appear. Double-check that the range of cells you are going to format as a table is correct.

If you need to make an adjustment, you can overwrite the cell range in the box or simply click the small upward arrow, and then select the cells from your worksheet using the mouse.

If you data has headers, make sure the ‘My table has headers’ box is checked. Click OK.

select every other row in excel - format data as a table 02

Your data will now be formatted as a table object. The default color formatting will be applied and every other row will be colored.

format data as a table 03

You can quickly adjust the color formatting by selecting any cell within your data table and then clicking Table Design up on the ribbon.

In the ‘Table Styles’ section, you have the option to change the table’s color from a selection of pre-set formats. Customization is also available.

format data as a table 04

‘Go To Special’ Hack

This technique works great if you want to select every other row in Excel within your data set to then delete it.

First we create a “helper” column in the first column to the left of our data set. Give it a header to clearly mark it’s purpose, it will be deleted later on.

In the first row of the helper column, insert an ‘X’. Then click on this cell and drag your mouse down to the cell below, so that both of the cells are now selected.

select every other row in excel - go to special hack 01

Now the first to cells are selected, notice the small green square in the bottom-right of the selected cells – this is the Auto Fill Handle.

Click and hold the Auto Fill Handle, and drag the mouse down to extend the selection to all of the rows in your data set.

select every other row in excel - go to special hack 02

Auto Fill Handle

The cursor changes to a small black plus sign when you mouse over the auto fill handle to indicate it is active.

Clicking and dragging down will extend the “X then blank” pattern to all of the cells you select.

Alternatively, you can double-click the fill handle and it will automatically extend down to the end of your data set.

The auto fill handle is a really useful feature on Excel. You can read more about it’s functionality in this post on 6 Ways To Use The Fill Handle In Excel

Now we have created a recognizable pattern of “X then blank” for every 2 cells in the helper column. With these cells still selected, click:

Home –> Find & Select –> Go To Special…

This will open the ‘Go To Special’ dialog box. Select the ‘Blanks’ radio button then click OK.

go to special hack 03

Excel will now create a non-contiguous cell selection on the blank cells in the helper column. Now we can right-click on any of the selected cells and click Delete. This will launch the ‘Delete’ dialog box where you can then select Entire Row and then click OK.

Every other row will be deleted and the data will be pushed up into the gaps.

go to special hack 04

go to special hack 05

You can now delete your helper column

VBA (Automation)

VBA (visual basic for applications) is Excel’s built-in programming language. We can use this small script to automatically select every other row of a given range.

To use the script, copy and paste it into a new module in the VBA Editor.

To open a new module, go to Developer –> Visual Basic. If you don’t see the Developer tab on the ribbon, you’ll need to activate it first.

When in the VBA Editor, click Insert –> Module

Sub SelectEveryOtherRow()

Dim userRange As Range
Dim alternateRowRange As Range
Dim rowCount, i As Long

Set userRange = Selection
rowCount = userRange.Rows.Count

With userRange

Set alternateRowRange = .Rows(1)

For i = 3 To rowCount Step 2
Set alternateRowRange = Union(alternateRowRange, .Rows(i))
Next i

End With

alternateRowRange.Select

End Sub

To run this code, a user will need to make a selection of cells that they want to select every other row from first. The code works by looping through the selected range and adds every other row to a range variable which is then selected at the end of the programme.

Summary

Here we have looked at 5 different ways to select every other row in Excel. As we have seen, there are many methods available for us to do this from conditional formatting to automated selection via VBA.

See all How-To Articles

This tutorial demonstrates how to select every other row in Excel and Google Sheets.

select every other row intro

When you’re working with data in Excel, you have a need to select the data in every other row. There are a few ways to select every other row.

Select Every Other Row

Keyboard and Mouse

  1. Click on the row header to select the first row.

select-every other row select row

  1. Holding down the CTRL key on the keyboard, click in the row header of the second row.

select every-other row select next row

  1. With the CTRL key still held down, click on every other row header until all the rows you need are selected.

select every other row selected

Cell Format and Filter

You can use Format as Table and filtering to select every other row.

  1. Highlight the cells whose rows you wish to select. In the Ribbon, go to Home > Cells > Format as Table and select the formatting.

excel-copy alternate format table

  1. Then, to remove the table, in the Ribbon, select Table > Convert to Range.

excel-copyrows convert to range

  1. Next, in the Ribbon, select Home > Editing > Sort & Filter > Filter.

excel copyrows filter

  1. Click the drop-down arrow on any of the column headings and select Filter by Color.

excel copyrows filterbycolor

  1. Every second row is now filtered for. Select these rows.

select every other row filter

Conditional Formatting and Filter

You can use Conditional Formatting and Filtering to select every other row.

  1. Highlight the cells whose rows you wish to select. In the Ribbon, go to Home > Cells >Conditional Formatting.

select every other row conditional formatting

  1. Select (1) Use a formula to determine which cells to format and then (2) enter the formula:
=MOD(ROW(B3),2)=0

Then (3) click on Format…

select every other row enter formula

  • The ROW Function returns the row number of the cell.
  • The MOD Function, here, tests whether a number is even or odd by returning the remainder of the ROW formula divided by 2.
  1. In the Fill tab, select the color to format each alternate row, and click OK.

select-every other row select color

  1. Click OK again to apply the formatting to your worksheet.

select every other formatted

  1. As with Format as a Table, you can now Filter by Color to select every alternate row.

select every other row filter by color

All the rows with the yellow cells are shown.

select every row filtered

Select Every Other Row in Google Sheets

As with Excel, you can select every other row in a Google Sheet by selecting the first row and then holding down the CTRL key and selecting each alternate row thereafter.

select every other row gs control key

You can also use conditional formatting and filtering to select every other row.

  1. Highlight the cells whose rows you wish to select. In the Menu, select Format > Conditional Formatting.

select every other gs conditional formatting

  1. Select (1) Custom formula is from the Format cells if… list and then (2) type in the following formula:
=MOD(ROW(B3),2)=0

Then (3) select the color you wish every other row in the selection to be formatted with.

select-every other gs format rules

  1. Click Done to format the sheet.
  2. Then create a filter to filter the rows by color.
    In the Menu, select Data > Create a filter.

select every other gs create filter

  1. In the filter drop-down list at the top of one of the columns, select Filter by Color > Fill Color and then select which color to filter on.

select every other gs filter by color

Every other row is now shown.

select every other gs filtered

See also: How to Display Data With Banded Rows

Когда мы используем рабочий лист, иногда нам нужно выбрать каждую вторую или n-ю строку листа для форматирования, удаления или копирования. Вы можете выбрать их вручную, но если есть сотни строк, этот метод не лучший выбор. Вот несколько уловок, которые могут вам помочь.

Выберите каждую вторую или n-ю строку с помощью VBA

Выберите каждую вторую или n-ю строку с помощью Kutools for Excelхорошая идея3


Выберите каждую вторую или n-ю строку с помощью VBA

В этом примере я выберу одну строку с двумя интервалами. С кодом VBA я могу закончить это следующим образом:

1. Выделите диапазон, который вы хотите выделить, каждую вторую или n-ю строку.

2.Click Застройщик > Визуальный Бейсик, Новый Microsoft Visual Basic для приложений появится окно, щелкните Вставить > Модули, и введите в модуль следующий код:

Sub EveryOtherRow()
Dim rng As Range
Dim InputRng As Range
Dim OutRng As Range
Dim xInterval As Integer
xTitleId = "KutoolsforExcel"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
xInterval = Application.InputBox("Enter row interval", xTitleId, Type:=1)
For i = 1 To InputRng.Rows.Count Step xInterval + 1
    Set rng = InputRng.Cells(i, 1)
    If OutRng Is Nothing Then
        Set OutRng = rng
    Else
        Set OutRng = Application.Union(OutRng, rng)
    End If
Next
OutRng.EntireRow.Select
End Sub

3. затем нажмите док-умножить-расчет-3 кнопку для запуска кода. Появится диалоговое окно для выбора диапазона. Смотрите скриншот:

4. Нажмите OK, и в этом случае я ввожу 3 в другом всплывающем диалоговом окне в качестве строки интервала. Смотрите скриншот

5. Нажмите OK, и выбрана каждая третья строка. Смотрите скриншот:

Вы можете изменить интервал по мере необходимости во втором KutoolsforExcel Диалог.


Выберите каждую вторую или n-ю строку с помощью Kutools for Excel

С кодом VBA вы можете выбрать только одну строку с указанными интервалами, если вам нужно выбрать две, три или другие строки с указанными интервалами, Kutools for Excel поможет вам решить эту проблему легко и удобно.

После бесплатная установка Kutools for Excel, пожалуйста, сделайте следующее:

1. Нажмите Кутулс > Select > Select Interval Rows & Columns…, См. Снимок экрана:

док выбрать каждую вторую строку 8

2. в  Select Interval Rows & Columns диалоговое окно, щелкнитедокумент-заменить-диапазон-имена-7 кнопку для выбора нужного вам диапазона, выберите Rows or Columns от Select разделе., и укажите желаемое число в Interval of поле ввода и Rows поле ввода. Смотрите скриншот:

док выбрать каждую вторую строку 9

док выбрать каждую вторую строку 10

Ноты:
1. Если вам нужно выбрать все остальные строки в выделенном фрагменте, введите 2 в поле Интервалы ввода и 1 в поле Rows поле ввода.

2. Если вы хотите выделить всю нужную строку, вы можете установить флажок Select entire rows опцию.
док выбрать каждую вторую строку 11


Заштрихуйте каждую вторую строку или n-ю строку с помощью Kutools for Excel

Если вы хотите заштриховать диапазоны в каждой второй строке, чтобы данные выглядели более выдающимися, как показано на скриншоте ниже, вы можете применить Kutools for ExcelАвтора Alternate Row/Column Shading функция для быстрого выполнения работы.

После бесплатная установка Kutools for Excel, пожалуйста, сделайте следующее:

1. Выберите диапазон ячеек, для которых требуется интервал затенения, щелкните Кутулс > Format > Alternate Row/Column Shading.
док выбрать каждую вторую строку 14

2. в Alternate Row/Column Shading диалог, выполните следующие действия:

1) Выберите строки или столбцы, которые хотите заштриховать;

2) Выберите Conditional formatting or стандартное форматирование как вам нужно;

3) Укажите интервал штриховки;

4) Выберите цвет штриховки.
док выбрать каждую вторую строку 15

3. Нажмите Ok. Теперь диапазон закрашен в каждой n-й строке.

Если вы хотите убрать затенение, отметьте Удалить существующее затенение альтернативной строки вариант в Альтернативное затенение строки / столбца Диалог.


Статьи по теме:

  • Выберите каждый n-й столбец в Excel
  • Копировать каждую вторую строку
  • Удалить каждую вторую строку
  • Скрыть каждую вторую строку

Лучшие инструменты для работы в офисе

Kutools for Excel Решит большинство ваших проблем и повысит вашу производительность на 80%

  • Снова использовать: Быстро вставить сложные формулы, диаграммы и все, что вы использовали раньше; Зашифровать ячейки с паролем; Создать список рассылки и отправлять электронные письма …
  • Бар Супер Формулы (легко редактировать несколько строк текста и формул); Макет для чтения (легко читать и редактировать большое количество ячеек); Вставить в отфильтрованный диапазон
  • Объединить ячейки / строки / столбцы без потери данных; Разделить содержимое ячеек; Объединить повторяющиеся строки / столбцы… Предотвращение дублирования ячеек; Сравнить диапазоны
  • Выберите Дубликат или Уникальный Ряды; Выбрать пустые строки (все ячейки пустые); Супер находка и нечеткая находка во многих рабочих тетрадях; Случайный выбор …
  • Точная копия Несколько ячеек без изменения ссылки на формулу; Автоматическое создание ссылок на несколько листов; Вставить пули, Флажки и многое другое …
  • Извлечь текст, Добавить текст, Удалить по позиции, Удалить пробел; Создание и печать промежуточных итогов по страницам; Преобразование содержимого ячеек в комментарии
  • Суперфильтр (сохранять и применять схемы фильтров к другим листам); Расширенная сортировка по месяцам / неделям / дням, периодичности и др .; Специальный фильтр жирным, курсивом …
  • Комбинируйте книги и рабочие листы; Объединить таблицы на основе ключевых столбцов; Разделить данные на несколько листов; Пакетное преобразование xls, xlsx и PDF
  • Более 300 мощных функций. Поддерживает Office/Excel 2007-2021 и 365. Поддерживает все языки. Простое развертывание на вашем предприятии или в организации. Полнофункциональная 30-дневная бесплатная пробная версия. 60-дневная гарантия возврата денег.

вкладка kte 201905


Вкладка Office: интерфейс с вкладками в Office и упрощение работы

  • Включение редактирования и чтения с вкладками в Word, Excel, PowerPoint, Издатель, доступ, Visio и проект.
  • Открывайте и создавайте несколько документов на новых вкладках одного окна, а не в новых окнах.
  • Повышает вашу продуктивность на 50% и сокращает количество щелчков мышью на сотни каждый день!

офисный дно


Загрузить PDF


Загрузить PDF

Из этой статьи вы узнаете, как выделить каждую вторую строчку в Microsoft Excel на компьютерах под управлением Windows и macOS.

  1. Изображение с названием Highlight Every Other Row in Excel Step 1

    1

    Откройте в Excel электронную таблицу, куда хотите внести изменения. Для этого достаточно нажать на файл двойным щелчком мыши.

    • Данный метод подходит для всех видов данных. С его помощью можно редактировать данные по своему усмотрению, не затрагивая оформления.
  2. Изображение с названием Highlight Every Other Row in Excel Step 2

    2

    Выделите ячейки, которые хотите отформатировать. Наведите курсор на нужное место, нажмите левую кнопку мыши и, удерживая нажатие, переместите указатель, чтобы выделить все ячейки в диапазоне, которому вы хотите задать формат. [1]

    • Чтобы выделить каждую вторую ячейку во всем документе, нажмите на кнопку Выделить все. Это серая квадратная кнопка/ячейка в левом верхнем углу листа.
  3. Изображение с названием Highlight Every Other Row in Excel Step 3

    3

    Нажмите на

    Android 7 Dropdown

    рядом с опцией «Условное форматирование». Эта опция находится на вкладке «Главная», на панели инструментов в верхней части экрана. Появится меню.

  4. Изображение с названием Highlight Every Other Row in Excel Step 4

    4

    Нажмите на Создать правило. На экране появится диалоговое окно «Создание правила форматирования».

  5. Изображение с названием Highlight Every Other Row in Excel Step 5

    5

    В разделе «Выберите тип правила» выберите пункт Использовать формулу для определения форматируемых ячеек.

    • Если у вас Excel 2003, выберите пункт «формула» в меню «Условие 1».
  6. Изображение с названием Highlight Every Other Row in Excel Step 6

    6

    Введите формулу, которая выделит каждую вторую строчку. Введите следующую формулу в область для текста:[2]

    • =MOD(ROW(),2)=0
  7. Изображение с названием Highlight Every Other Row in Excel Step 7

    7

    Нажмите на кнопку Формат в диалоговом окне.

  8. Изображение с названием Highlight Every Other Row in Excel Step 8

    8

    Откройте вкладку Заливка вверху диалогового окна.

  9. Изображение с названием Highlight Every Other Row in Excel Step 9

    9

    Выберите узор или цвет для ячеек, которые вы хотите затенить, и нажмите OK. Под формулой появится образец цвета.

  10. Изображение с названием Highlight Every Other Row in Excel Step 10

    10

    Нажмите OK, чтобы выделить каждую вторую ячейку на листе выбранным цветом или узором.

    • Чтобы изменить формулу или формат, нажмите на стрелку рядом с опцией «Условное форматирование» (на вкладке «Главная»), выберите Управление правилами, а затем выберите правило.

    Реклама

  1. Изображение с названием Highlight Every Other Row in Excel Step 11

    1

    Откройте в Excel электронную таблицу, куда хотите внести изменения. Как правило, для этого достаточно нажать на файл двойным щелчком мыши.

  2. Изображение с названием Highlight Every Other Row in Excel Step 12

    2

    Выделите ячейки, которые хотите отформатировать. Наведите курсор на нужное место, нажмите левую кнопку мыши и, удерживая нажатие, переместите указатель, чтобы выделить все ячейки в нужном диапазоне.

    • Если вы хотите выделить каждую вторую ячейку во всем документе, нажмите Command+A на клавиатуре. Так вы выделите все ячейки на листе.
  3. Изображение с названием Highlight Every Other Row in Excel Step 13

    3

    Нажмите на

    Android 7 Dropdown

    рядом с опцией «Условное форматирование». Эта опция находится на вкладке «Главная», на панели инструментов в верхней части экрана. После этого вы увидите несколько опций для форматирования.

  4. Изображение с названием Highlight Every Other Row in Excel Step 14

    4

    Нажмите на опцию Создать правило. На экране появится новое диалоговое окно «Создание правила форматирования» с несколькими опциями для форматирования.

  5. Изображение с названием Highlight Every Other Row in Excel Step 15

    5

    В меню «Стиль» выберите классический. Нажмите на выпадающее меню «Стиль», а затем выберите классический в самом низу.

  6. Изображение с названием Highlight Every Other Row in Excel Step 16

    6

    Выберите пункт Использовать формулу для определения форматируемых ячеек. Нажмите на выпадающее меню под опцией «Стиль» и выберите пункт Использовать формулу, чтобы изменить формат с помощью формулы.

  7. Изображение с названием Highlight Every Other Row in Excel Step 17

    7

    Введите формулу, которая выделит каждую вторую строчку. Нажмите на поле для формул в окне «Создание правила форматирования» и введите следующую формулу: [3]

    • =MOD(ROW(),2)=0
  8. Изображение с названием Highlight Every Other Row in Excel Step 18

    8

    Нажмите на выпадающее меню рядом с опцией Форматировать с помощью. Она находится в самом низу, под полем для ввода формулы. Раскроется меню с опциями для форматирования.

    • Выбранный формат будет применен к каждой второй ячейке в диапазоне.
  9. Изображение с названием Highlight Every Other Row in Excel Step 19

    9

    Выберите формат в выпадающем меню «Форматировать с помощью». Выберите любую опцию, а затем просмотрите образец в правой части диалогового окна.

    • Если вы хотите самостоятельно создать новый формат выделения другого цвета, нажмите на опцию свой формат в самом низу. После этого появится новое окно, в котором можно будет вручную ввести шрифты, границы и цвета.
  10. Изображение с названием Highlight Every Other Row in Excel Step 20

    10

    Нажмите OK, чтобы применить форматирование и выделить каждую вторую строчку в выбранном диапазоне на листе.

    • Это правило можно изменить в любое время. Для этого нажмите на стрелку рядом с опцией «Условное форматирование» (на вкладке «Главная»), выберите Управление правилами и выберите правило.

    Реклама

  1. Изображение с названием Highlight Every Other Row in Excel Step 21

    1

    Откройте в Excel электронную таблицу, которую хотите изменить. Для этого достаточно нажать на файл двойным щелчком мыши (Windows и Mac).

    • Используйте этот способ, если кроме выделения каждой второй строчки вы также хотите добавить в таблицу новые данные.
    • Используйте данный метод только в том случае, если не хотите изменять данные в таблице после того, как отформатируете стиль.
  2. Изображение с названием Highlight Every Other Row in Excel Step 22

    2

    Выделите ячейки, которые хотите добавить в таблицу. Наведите курсор на нужное место, нажмите левую кнопку мыши и, удерживая нажатие, переместите указатель, чтобы выделить все ячейки, формат которых хотите изменить.[4]

  3. Изображение с названием Highlight Every Other Row in Excel Step 23

    3

    Нажмите на опцию Форматировать как таблицу. Она находится на вкладке «Главная», на панели инструментов вверху программы.[5]

  4. Изображение с названием Highlight Every Other Row in Excel Step 24

    4

    Выберите стиль таблицы. Просмотрите варианты в разделах «Светлый», «Средний» и «Темный» и нажмите на тот стиль, который хотите применить.

  5. Изображение с названием Highlight Every Other Row in Excel Step 25

    5

    Нажмите OK, чтобы применить данный стиль к выбранному диапазону данных.

    • Чтобы изменить стиль таблицы, включите или отключите опции в разделе «Параметры стилей таблицы» на панели инструментов. Если этого раздела нет, нажмите на любую ячейку в таблице, и он появится.
    • Если вы хотите преобразовать таблицу обратно в диапазон ячеек, чтобы иметь возможность редактировать данные, нажмите на нее, чтобы отобразить параметры на панели инструментов, откройте вкладку Конструктор и нажмите на опцию Преобразовать в диапазон.

    Реклама

Об этой статье

Эту страницу просматривали 32 718 раз.

Была ли эта статья полезной?

Watch Video – How to Highlight Alternate (Every Other Row) in Excel

Below is the complete written tutorial, in case you prefer reading over watching a video.

Conditional Formatting in Excel can be a great ally in while working with spreadsheets.

A trick as simple as the one to highlight every other row in Excel could immensely increase the readability of your data set.

And it is as EASY as PIE.

Suppose you have a dataset as shown below:Highlight Every Other Row in Excel using Conditional Formatting - Select Data

Let’s say you want to highlight every second month (i.e., February, April and so on) in this data set.

This can easily be achieved using conditional formatting.

Highlight Every Other Row in Excel

Here are the steps to highlight every alternate row in Excel:

  1. Select the data set (B4:D15 in this case).Highlight Every Other Row in Excel using Conditional Formatting - Seelct Data
  2. Open the Conditional Formatting dialogue box (Home–> Conditional Formatting–> New Rule) [Keyboard Shortcut – Alt + O + D].Highlight Every other Row in Excel using Conditional Formatting - New Rule
  3. In the dialogue box, click on “Use a Formula to determine which cells to format” option.Highlight Every other Row in Excel using Conditional Formatting - Use a fromula
  4. In Edit the Rule Description section, enter the following formula in the field:
    =MOD(ROW(),2)=1Highlight Every other Row in Excel using Conditional Formatting - MOD Formula
  1. Click on the Format button to set the formatting.Highlight Every Nth Row in Excel using Conditional Formatting - Set Format
  2. Click OK.Highlight Every other Row in Excel using Conditional Formatting - Click OK

That’s it!! You have the alternate rows highlighted.Highlight Every other Row in Excel using Conditional Formatting - highlighted data

How does it Work?

Now let’s take a step back and understand how this thing works.

The entire magic is in the formula =MOD(ROW(),2)=1. [MOD formula returns the remainder when the ROW number is divided by 2].

This evaluates each cell and checks if it meets the criteria. So it first checks B4. Since the ROW function in B4 would return 4, =MOD(4,2) returns 0, which does not meet our specified criteria.

So it moves on to the other cell in next row.

Here Row number of cell B5 is 5 and =MOD(5,1) returns 1, which meets the condition. Hence, it highlights this entire row (since all the cells in this row have the same row number).

You can change the formula according to your requirements. Here are a few examples:

  • Highlight every 2nd row starting from the first row =MOD(ROW(),2)=0
  • Highlight every 3rd Row =MOD(ROW(),3)=1
  • Highlight every 2nd column =MOD(COLUMN(),2)=0

These banded rows are also called zebra lines and are quite helpful in increasing the readability of the data set.

If you plan to print this, make sure you use a light shade to highlight the rows so that it is readable.

Bonus Tip: Another quick way to highlight alternate rows in Excel is to convert the data range into an Excel Table. As a part of the Excl Table formatting, you can easily highlight alternate rows in Excel (all you need is to use the check the Banded Rows option as shown below):

Highlight Altenate Rows in Excel - Banded Rows

You May Also Like the Following Excel Tutorials:

  • Creating a Heat Map in Excel.
  • How to Apply Conditional Formatting in a Pivot Table in Excel.
  • Conditional Formatting to Create 100% Stacked Bar Chart in Excel.
  • How to Insert Multiple Rows in Excel.
  • How to Count Colored Cells in Excel.
  • How to Highlight Blank Cells in Excel.
  • 7 Quick & Easy Ways to Number Rows in Excel.
  • How to Compare Two Columns in Excel.
  • Insert a Blank Row after Every Row in Excel (or Every Nth Row)
  • Apply Conditional Formatting Based on Another Column in Excel
  • Select Every Other Row in Excel

Понравилась статья? Поделить с друзьями:
  • Excel document file format
  • Excel etc что это
  • Excel document cannot be saved
  • Excel es 70 ex4
  • Excel error runtime error 13 type mismatch как исправить