跳到主要內容

如何根據Excel中的單元格值更改背景或字體顏色?

當您在Excel中處理大量數據時,您可能希望選擇一些值並用特定的背景或字體顏色突出顯示它們。 本文討論的是如何根據Excel中的單元格值快速更改背景或字體顏色。


方法1:使用條件格式根據單元格值動態更改背景或字體顏色

 

條件格式 功能可以幫助您突出顯示大於x,小於y或x與y之間的值。

假設您有一系列數據,現在需要為80到100之間的值上色,請執行以下步驟:

1。 選擇要突出顯示某些單元格的單元格範圍,然後單擊 首頁 > 條件格式 > 新規則,請參見屏幕截圖:

doc按值突出顯示1

2。 在 新格式規則 對話框中,選擇 僅格式化包含以下內容的單元格 中的項目 選擇規則類型 框,然後在 僅使用格式化單元格 部分中,指定所需的條件:

  • 在第一個下拉框中,選擇 單元格值;
  • 在第二個下拉框中,選擇條件:之間;
  • 在第三個和第四個框中,輸入過濾條件,例如80、100。

doc按值突出顯示2

3。 然後,點擊 格式 按鈕,在 單元格格式 對話框中,將背景或字體顏色設置為:

通過單元格值更改背景顏色: 通過單元格值更改字體顏色
點擊 標籤,然後選擇您喜歡的一種背景色 點擊 字體 標籤,然後選擇所需的字體顏色。
doc按值突出顯示3 doc按值突出顯示4

4. 選擇背景或字體顏色後,單擊 OK > OK 關閉對話框,現在,值在80到100之間的特定單元格將更改為所選內容中的特定背景或字體顏色。 看截圖:

用背景色突出顯示特定的單元格: 用字體顏色突出顯示特定的單元格:
doc按值突出顯示5 doc按值突出顯示6

備註:“ 條件格式 如果是動態功能,則單元格顏色將隨著數據的變化而變化。


方法2:使用查找功能基於單元格值靜態更改背景或字體顏色

 

有時,您需要基於單元格值應用特定的填充或字體顏色,並在單元格值更改時使填充或字體顏色不變。 在這種情況下,您可以使用 發現 函數查找所有特定的單元格值,然後根據需要更改背景或字體顏色。

例如,如果單元格值包含“ Excel”文本,則要更改背景或字體顏色,請執行以下操作:

1。 選擇您要使用的數據范圍,然後單擊 首頁 > 查找和選擇 > 發現,請參見屏幕截圖:

doc按值突出顯示7

2。 在 查找和替換 對話框中的 發現 標籤,將您要查找的值輸入到 查找內容 文本框,請參見屏幕截圖:

doc按值突出顯示8

保養竅門: 如果您需要查找區分大小寫的值或匹配整個單元格內容的值,請單擊 選項 按鈕以獲取高級搜索選項,例如“區分大小寫“和”匹配整個單元格內容”。

3。 然後,單擊 找到所有 按鈕,在“查找結果”框中,單擊任意一項,然後按 按Ctrl + A 要選擇所有找到的項目,請參見屏幕截圖:

doc按值突出顯示9

4。 最後點擊 關閉 按鈕關閉此對話框。 現在,您可以為這些選定的值填充背景或字體顏色,請參見屏幕截圖:

為所選單元格應用背景色: 應用所選單元格的字體顏色:
doc按值突出顯示10 doc按值突出顯示11

方法3:使用Kutools for Excel靜態基於單元格值更改背景或字體顏色

 

Excel的Kutools超級查找 該功能支持用於查找值,文本字符串,日期,公式,格式化的單元格等的許多條件。 找到並選擇匹配的單元格後,您可以將背景或字體顏色更改為所需的顏色。

安裝後 Excel的Kutools,請這樣做:

1。 選擇您要查找的數據范圍,然後單擊 庫工具 > 超級查找,請參見屏幕截圖:

doc按值突出顯示12

2。 在 超級查找 窗格,請執行以下操作:

  • (1.)首先,單擊 價值觀 選項圖標;
  • (2.)從 下拉,在這種情況下,我會選擇 選擇;
  • (3.)從 類別 下拉列表中,選擇要使用的條件;
  • (4.)然後單擊 發現 按鈕將所有相應的結果列出到列錶框中;
  • (5.)最後,單擊 選擇 按鈕選擇單元格。

doc按值突出顯示13

3。 然後,一次選擇了所有符合條件的單元格,請參見屏幕截圖:

doc按值突出顯示14

4。 現在,您可以根據需要更改所選單元格的背景顏色或字體顏色。


週末忙於工作,使用 Excel的Kutools,
給您一個輕鬆愉快的周末!

週末,孩子們大聲疾呼要出去玩,但周圍有太多工作無法陪伴家人。 太陽,沙灘和大海那麼遠? Excel的Kutools 幫助您 解決Excel難題,節省工作時間。

圖片海灘
  •  獲得晉升和增加薪水並不是遙不可及的。
  •  包含高級功能,解決應用場景,部分功能甚至節省99%的工作時間;
  •  在3分鐘內成為Excel專家,並獲得您的同事或朋友的認可;
  •  不再需要從Google搜索解決方案,不必再為痛苦的公式和VBA代碼告別了;
  •  只需單擊幾下,即可完成所有重複的操作,從而解放了您的手;
  •  只有39美元,但比其他人的4000美元的Excel教程更有價值;
  •  被110,000名精英和300多家知名公司選中;
  •  30天免費試用,並在60天內無條件全額退款;
  •  改變工作方式,然後改變生活方式!
 

Comments (79)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Good Day,

I have a schedule with different course modules that can be placed in different order ( 1 is metal, 2 is machining, 3 is refinishing, etc.) depending on course director preferences and staff availability.

What I am trying to do to wrap up the spreadsheet is color code the modules across the months based on their order in the overall course. So if Metal is first and is 35 days long, the first 35 days are background colored blue, but if machining is first and is 20 days long, then the first 20 days are purple.

How can you do and if statement that refers to a separate cell for the initial number of days, AND color the cells based on the range between 1 and 20 or 35 or whatever?

Can I do a conditional formatting If statement with a range between numbers?

This would have to be applied to all the modules (therefor multiple conditional formatting formulas) to account for any module being in any place in the order.
That is the issue I have. Please offer any suggestions. Note that I have built the spreadsheet without VBA. (I've never had the opportunity to learn it)
This comment was minimized by the moderator on the site
Can I give colour for a row of values with respect to previous value for a whole row.
Eg

23

45

32

56

can I give red for 23 and green for 45 and again red for 32 as it is less than the previous value and green for 56 as it is more than 32.
This comment was minimized by the moderator on the site
I do get to change a cell colour according to the text or letter in fill in the cell e.g.-H=YELLOW,E=GREEN
This comment was minimized by the moderator on the site
Hello, VANESSA,
For solving your problem, please apply the Conditional Formatting feature, in the New Formatting Rule dialog box, choose the conditions as following screenshot shown:
This comment was minimized by the moderator on the site
how do i change the colour of cell depending on what is in that cell IE. Y=green N=red.

thats how i need it if it has Y riten in the cell it turns green?
This comment was minimized by the moderator on the site
Hello, Leon,
To highlight the cells based on the cell value, you should apply the Conditional Formatting feature, go to the New Formatting Rule dialog box, and then do as the following screenshot shown to highlight the cells which are Y located as green:

Do with the same way to format the cells N as red color.

Please try it, hope it can help you!
This comment was minimized by the moderator on the site
Trying to get a cell to highlight if its above a certain number, the problem is that the cell includes the number and a date. Is there a way i can get it to just look at the number? The cell will include a number+date.....1400(7/2/2018). I need the formulate just to look at the 1400 and not the date.
any ideas?
thanks
Z
This comment was minimized by the moderator on the site
Sir, I have value in cell A10, in A12. Now I entered a simple formula in A15 subtracting these (A10-A12). I want background color of result cell (A15) in green if A10 is large (means result in positive number) and background color in red if A12 is large ( result in negative number). Please provide solution
This comment was minimized by the moderator on the site
Hello,
You can select the formula cells, and then apply the Conditional Formatting > Greater than (0)-format it green, and then Less Than (0)-format it red, see screenshot:

Please try it, hope it can help you, thank you!
This comment was minimized by the moderator on the site
If I have a date in a cell, how do I make it change to orange when it is within 30 days of coming due, yellow when it is within 15 days of coming due and red when it exceeds the date (past due)
This comment was minimized by the moderator on the site
I thought this color of cells by value was going to be a real pain. It could not have been explained more easily and clearly. Thanks. It took no less than 1-2 minutes to understand what to do.
This comment was minimized by the moderator on the site
HI, I want if i change any value or number in any cell then that cell text color should get change for e.g. if number in any cell is 100 and I have to change it as 98 then that cell text 98 should change into red color. Is it possible in Excel?? Do clarify please
This comment was minimized by the moderator on the site
So I am creating a excel spreadsheet for fire department reports. What I am looking for is it to calculate the days a report is overdue, unless it has been completed: Column A Column B Column C Column D Column E Column F Incident # Incident Date Todays Date Completed Date Days Overdue Todays Date I want column B subtracting Column C to calculate in column E unless Column D is complete. I hope this makes sense. I want to use the conditional formatting to show me in colors how long a report is overdue (with the 3 color scale). I have the formula for the number of days it is overdue to have a correct value and color scale, but I want it to remain green when the report has been completed.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations