Table of Contents
Part 1: How to apply color to alternating rows in MS Excel
第 2 部分:如何将颜色应用于 MS Excel 中的备用列
Home Common Problem How to color alternating rows or columns in MS Excel

How to color alternating rows or columns in MS Excel

May 22, 2023 pm 05:56 PM
Cell button Tab excel official filling

To make your Excel document more attractive, it's a good idea to add some color. It's very easy to select all the cells you want to add color to and then choose the color you like. But wouldn't it be fun if you could color the odd rows/columns with one color and the even rows/columns with another color? Of course, it will make your Excel document stand out.

So, what is the fastest solution to automatically color alternating rows or columns in MS Excel? Well, that’s exactly why we’re here to help you today. Read on to master this cool Excel trick in simple steps. Hope you enjoyed reading this article.

如何在 MS Excel 中为交替行或列着色

Part 1: How to apply color to alternating rows in MS Excel

Step 1: First start the Excel job table and selectthe range in the Excel worksheet where you want to apply the color to alternating rows.

Then click the Home tab on the top ribbon.

Next, click the Conditional Formatting drop-down button and click the New Rule option.

如何在 MS Excel 中为交替行或列着色

Step 2: In the New Formatting Rule window, in the Select a Rule Type section , click the last rule type, Use a formula to determine which cells to format.

Next, under the Format values ​​where this formula is true section, copy and paste the following formula.

=MOD(行(),2)=0
Copy after login

Rule Description

FunctionROW()Will return the row ID of the first row in the selected range. The return value will be 2 because the range we selected starts at line 2. MOD()The function will find the remainder of the row id divided by the number 2, which is equal to 0. If it equals 0, the formula is true, and then the format we selected using the "Format" button will be applied to that row. Repeat the same process for all rows.

Now let's decide on the color. To do this, click the "Format" button.

如何在 MS Excel 中为交替行或列着色

Step 3: In the "Set CellFormat" window, click "" at the top of the window Fill tab.

Now, from the available color options, click the color you want to apply to the even rows in Excel. You have other options like Fill Effect, More Colors, Pattern Color, Pattern Style, etc.

After you finish selecting your color, just click the OK button.

如何在 MS Excel 中为交替行或列着色

Step 4: You will now be returned to the "New Formatting Rules" window. Click the OK button to continue.

如何在 MS Excel 中为交替行或列着色

Step 5: That’s it. You can see that the even rows in the selected range are now formatted with the color of your choice!

如何在 MS Excel 中为交替行或列着色

If you could color only the even rows and use the default white for the odd rows, then you would set them all up for alternating row coloring. However, if you want the odd rows to also be colored with another color of your choice, then you can continue with the following steps. Remember, the steps are all the same, the only difference is the formula used.

Step 6

: As before, select the area that you want to color the odd rows. After selecting the area, click the

HOME button at the top.

Next, click the

Conditional Formatting

button and select New Rule.

如何在 MS Excel 中为交替行或列着色

Step 7

: This time, select the Use formulas to determine which cells to format option. Now, copy and paste the following formula

onto the field formula value

where the formula is true.

=MOD(行(),2)=1
Copy after login

Rule description

This time the formula checks whether the row id is divisible by 2. If division is possible, the remainder is 0, otherwise it is

1

. That is, for an odd number of rows, the formula =MOD(ROW(),2)=1 will return true.

点击格式按钮以选择公式为真的情况的格式。

如何在 MS Excel 中为交替行或列着色

第 8 步:您可以转到“设置单元格格式”窗口上的“填充”选项卡,然后选择您选择的颜色

点击确定按钮继续。

如何在 MS Excel 中为交替行或列着色

第 9 步:当您返回“新格式规则”窗口时,点击“确定”按钮以查看正在使用的替代颜色。

如何在 MS Excel 中为交替行或列着色

第10步:就是这样。现在,您的 Excel 工作表中的交替行已完美着色,就像您希望的那样。享受!

如何在 MS Excel 中为交替行或列着色

第 2 部分:如何将颜色应用于 MS Excel 中的备用列

交替着色列的步骤与我们为交替行着色的步骤完全相同。显然,唯一的区别在于使用的规则,我们将在下面的步骤中详细说明。

第 1 步:选择要交替着色的列范围。

从顶部功能区点击主页选项卡。

单击条件格式下拉按钮,然后单击新规则选项。

如何在 MS Excel 中为交替行或列着色

第 2 步:在“选择规则类型”部分下,单击“使用公式确定要格式化的单元格”选项。

现在,在此公式为 true 的 Format Values 下复制并粘贴以下公式。

=MOD(列(),2)=0
Copy after login

要设置格式,请单击“格式”按钮。

如何在 MS Excel 中为交替行或列着色

第 3 步:转到“填充”选项卡并为偶数列选择您选择的颜色。

点击确定按钮。

如何在 MS Excel 中为交替行或列着色

第 4 步:当您返回到 New Formatting Rule 窗口时,按Enter键或按OK按钮继续。

如何在 MS Excel 中为交替行或列着色

第5步:就是这样。您现在可以看到备用偶数列使用您选择的颜色着色。

如何在 MS Excel 中为交替行或列着色

如果您对奇数列的默认白色表示满意,您可以在此处停止。如果您希望给奇数列也设定特定颜色,在接下来的步骤中可以继续操作。

第 6 步:与往常一样,首先选择该区域,然后从顶部功能区点击主页选项卡。

单击条件格式下拉按钮,然后单击新规则选项。

如何在 MS Excel 中为交替行或列着色

第 7 步:单击“选择规则类型”部分中的“使用公式确定要格式化的单元格” 选项。

现在在此公式为 true的字段格式值下,复制并粘贴以下公式。

=MOD(列(),2)=1
Copy after login

要应用格式,请单击“格式”按钮。

如何在 MS Excel 中为交替行或列着色

第 8 步:单击“设置单元格格式”窗口上的“填充”选项卡,然后为奇数列选择您选择的颜色。

完成后点击确定按钮。

如何在 MS Excel 中为交替行或列着色

第 9 步:在随后出现的窗口中点击OK按钮。

如何在 MS Excel 中为交替行或列着色

Step 10: Your columns should now have a nice color to choose from, as shown in the screenshot below.

如何在 MS Excel 中为交替行或列着色

The above is the detailed content of How to color alternating rows or columns in MS Excel. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Fix: VAN 1067 error when running Valorant on Windows 11 Fix: VAN 1067 error when running Valorant on Windows 11 May 22, 2023 pm 02:41 PM

The operating system looks much better than its predecessor and has gamer-oriented features like AutoHDR and DirectStorage, but Valorant players have had some trouble launching the game. This is not the first issue faced by gamers earlier, Valorant not opening on Windows 11 is another issue plaguing them but we have covered the ways to fix it. Now it seems that Valorant players who switched to Windows 11 are facing issues due to Secure Boot and TPM2.0 services, which causes the game menu to only show an exit option while running. Many users are getting the VAN1067 error, but it shouldn't be a cause for alarm

How to embed a PDF document in an Excel worksheet How to embed a PDF document in an Excel worksheet May 28, 2023 am 09:17 AM

It is usually necessary to insert PDF documents into Excel worksheets. Just like a company's project list, we can instantly append text and character data to Excel cells. But what if you want to attach the solution design for a specific project to its corresponding data row? Well, people often stop and think. Sometimes thinking doesn't work either because the solution isn't simple. Dig deeper into this article to learn how to easily insert multiple PDF documents into an Excel worksheet, along with very specific rows of data. Example Scenario In the example shown in this article, we have a column called ProductCategory that lists a project name in each cell. Another column ProductSpeci

How to prevent Excel from removing leading zeros How to prevent Excel from removing leading zeros Feb 29, 2024 am 10:00 AM

Is it frustrating to automatically remove leading zeros from Excel workbooks? When you enter a number into a cell, Excel often removes the leading zeros in front of the number. By default, it treats cell entries that lack explicit formatting as numeric values. Leading zeros are generally considered irrelevant in number formats and are therefore omitted. Additionally, leading zeros can cause problems in certain numerical operations. Therefore, zeros are automatically removed. This article will teach you how to retain leading zeros in Excel to ensure that the entered numeric data such as account numbers, zip codes, phone numbers, etc. are in the correct format. In Excel, how to allow numbers to have zeros in front of them? You can preserve leading zeros of numbers in an Excel workbook, there are several methods to choose from. You can set the cell by

Change the power button action on Windows 11 [5 Tips] Change the power button action on Windows 11 [5 Tips] Sep 29, 2023 pm 11:29 PM

The power button can do more than shut down your PC, although this is the default action for desktop users. If you want to change the power button action in Windows 11, it's easier than you think! Keep in mind that the physical power button is different from the button in the Start menu, and the changes below won't affect the operation of the latter. Additionally, you'll find slightly different power options depending on whether it's a desktop or laptop. Why should you change the power button action in Windows 11? If you put your computer to sleep more often than you shut it down, changing the way your hardware power button (that is, the physical power button on your PC) behaves will do the trick. The same idea applies to sleep mode or simply turning off the display. Change Windows 11

How to use Vue to implement button countdown effects How to use Vue to implement button countdown effects Sep 21, 2023 pm 02:03 PM

How to use Vue to implement button countdown effects With the increasing popularity of web applications, we often need to use some dynamic effects to improve user experience when users interact with the page. Among them, the countdown effect of the button is a very common and practical effect. This article will introduce how to use the Vue framework to implement button countdown effects and give specific code examples. First, we need to create a Vue component that contains a button and countdown function. In Vue, a component is a reusable Vue instance, and a view will

How to add/remove watermark in Word document How to add/remove watermark in Word document May 24, 2023 pm 12:52 PM

Basically, a watermark is a phrase or image in a light gray shade that is added as a background to any page or part of a document. It is placed in such a way that it has a light shadow so that it does not interfere with the visibility of the content in the document. Typically, you must see documents with a company logo, brand name, or phrases like Draft or Confidential as watermarks. Using watermarks in your documents helps protect your content or any other items that you don't want others to claim as theirs. Therefore, watermarks can be used to prevent copying/forgery of your document content. Are you considering adding a watermark to protect your documents or removing the existing watermark once it has served its purpose? In this article, we discussed how to add and remove watermarks in Word documents. How to add watermark in Word 1. Click

Why won't my laptop start up after pressing the power button? Why won't my laptop start up after pressing the power button? Mar 10, 2024 am 09:31 AM

There could be several reasons why your Windows laptop won't boot. Memory failure, dead battery, faulty power button, or hardware issues are all common causes. Here are some solutions to help you resolve this issue. Laptop won't turn on after pressing the power button If your Windows laptop still won't turn on after pressing the power button, here are some steps you can take to resolve the issue: Is your laptop fully charged? Perform a hard reset to clean your laptop Reseat the memory Transparent CMOS type battery Take your laptop for repair. 1] Is your laptop fully charged? The first thing to do is to check if your laptop is fully charged. Laptop won't start if battery is drained

iOS 17: How to organize iMessage apps in Messages iOS 17: How to organize iMessage apps in Messages Sep 18, 2023 pm 05:25 PM

In iOS 17, Apple not only added several new messaging features, but also tweaked the design of the Messages app to give it a cleaner look. All iMessage apps and tools, such as the camera and photo options, can now be accessed by tapping the "+" button above the keyboard and to the left of the text input field. Clicking the "+" button brings up a menu column with a default order of options. Starting from the top, there's camera, photos, stickers, cash (if available), audio, and location. At the very bottom is a "More" button, which when tapped will reveal any other installed messaging apps (you can also swipe up to reveal this hidden list). How to reorganize your iMessage app You can do this below