跳到主要內容

如何在Excel中基於另一個單元格值對單元格著色?

假設如果單元格B1滿足諸如具有某個特定值或該值大於或小於特定數字的條件,則您希望使用特定的背景色為該單元格(例如A4)著色。 你會怎麼做? 本文將向您展示該方法。

使用條件格式基於另一個單元格值對單元格進行著色


使用條件格式基於另一個單元格值對單元格進行著色

您可以執行以下操作,以基於Excel中的另一個單元格值對單元格進行著色。

1.根據另一個單元格值選擇要著色的單元格(例如A1),然後單擊 條件格式 > 新規則 在 首頁 標籤。

2。 在裡面 新格式規則 對話框,您需要:

  • 2.1選擇 使用公式來確定要格式化的單元格 在選項 選擇規則類型 框;
  • 2.2如果要在B1的值大於4時為單元格A500著色,請輸入公式 = $ B4> 500格式化此公式為真的值 框;
    保養竅門:如果要在B1具有某個值(例如“測試”)時為單元格A4著色,請使用此公式 = $ B4 =“測試”。 您可以根據需要在公式中更改變量。
  • 2.3點擊 格式 按鈕指定背景顏色;
  • 2.4點擊 OK 當它返回到 新格式規則 對話框。 看截圖:

然後,您可以看到指定的單元格根據另一個單元格的值被著色,如下圖所示。


相關文章:

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (17)
Rated 4 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
I just wanted to leave my experience after reading the comments left here when in need of accomplishing entire columns needing to correlate to their respective rows under another column.
I hope I can help out the community for anyone else in search for answers with the same needs as I had.

This example is if you need each cell to act independently according to a cell in its own respective row. For example: Looking at row 4 I need my cell in column H to change color based on a value in column F (still in row 4). Lets say in this case I need H4 to change when the word Complete is entered in F4. (But I need this rule to apply for all rows. -Lets say I have 104 rows total.)

Conditional Formatting: New Rule > "Use a formula to determine which cells to format" - Format values where this formula is true: (enter the following) =$F1:$F104="Complete" (-Choose Format desired)
(We now need to add the cells this new rule applies to, enter the following) =$H$1:$H$104 > Apply > OK

You should now have independent rows formatting cells in column H dependent on the value "Complete" being entered in cells in column F.
Rated 4 out of 5
This comment was minimized by the moderator on the site
I have two column Buy Units (A) and Sell unites (B). When typing sell units B column, If B1>A1 return red font in B1 value. (To say that there is typo= you can not sale more unit than you have got) FOR EACH TRANSACTIONS. Meaning same to be applied for B2>A2, B3>A3., B4>A4... I do not want to keep typing Conditional Formating for each single cell, just want to COPY and Paste. This seems relatively easy ask but taking me a toll! Can you please help?
This comment was minimized by the moderator on the site
Yes I want learn/ know this
This comment was minimized by the moderator on the site
How do I solve this ?
Say I have 5 Columns - CORRECT_ANS, PERSON1, PERSON2, PERSON3, PERSON4
and say 4 rows with values as below.

CORRECT_ANS, PERSON1, PERSON2, PERSON3, PERSON4
A B C A A
B A B D B
C C C A B
C A D C C

Values in Columns PERSON1 to PERSON4 should match against corrresponding row in CORRECT_ANS. If value is same, then Cell color to be GREEN, else RED.
So in 1st case, PERSON3 and PERSON4 cell should be GREEN, rest RED. Similarly 2nd row, PERSON2 and PERSON4 gets GREEN, rest RED, and so on.
This comment was minimized by the moderator on the site
what if I want a cell to be shaded based on the presence or absence of text in a different cell?
This comment was minimized by the moderator on the site
If you want the condition to format several cells on the same row, select them all and use the formula =$J1="your_text_here"
This comment was minimized by the moderator on the site
HI what if I want to condition a cell based on the presence or not of text in a different cell?
This comment was minimized by the moderator on the site
To apply this to multiple rows, use the same formula (Excel automatically continues the formula with relative values).
e.g. for the following sheet,
_|_A_B
1| 0 0
2| 0 1
3| 1 0
4| 1 1
to make A1 depend on B1, and A2 depend on B2, and so forth, use =$B1=0. To make all the cells in A depend on one cell in B, use =$B$1=0, and to make the cells in A depend on the cells in the next row of B, use =$B2=0 (with the A cells selected from A1).
This comment was minimized by the moderator on the site
Ho do I apply this rule by row
For example, I want Cell I2 to be formatted by G2. I3 by G3 and so on
This comment was minimized by the moderator on the site
Hey for doing it by row, let's say I want to make A red when B > 0.

For that I would go to A, and enter the formula =B:B > 0

That's how you would do this
This comment was minimized by the moderator on the site
Hi,
I want to dpo the following. Help me out.
A1 to be green if B1>0
A2 to be green if B1>0
.
.
.
.
A250 to be green if B250>0

I am unable to copy the formula to all the rows.
This comment was minimized by the moderator on the site
How can we apply the rule on multiple cells with a single formula? Applying the rule on every single cell will be a hectic job.
This comment was minimized by the moderator on the site
How might i format column N to be shaded according to value in column L? (Eg higher red, lower blue, equals green, no value - no shading)
Can i write a formula for column N in conditional formatting?

K L M N
DD 0.2 0.8

AM 0.8 1.0

TB 1.0 1.0

AM 1.0 1.0

TB 0.6 0.8

AM 0.4 0.4

AM 0.8 0.8


Any help appreciated
D
This comment was minimized by the moderator on the site
Hi Deb,
Sorry can't help you with that. Thank you for your comment.
This comment was minimized by the moderator on the site
Hey Deb and Crystal,

For doing it by row, let's say I want to make A red when B > 0.

For that I would go to A, and enter the formula =B:B > 0

That's how you would do this
This comment was minimized by the moderator on the site
i want to know formula for color change of cell on basis of two different cell values
This comment was minimized by the moderator on the site
Hi Manish,
Please try this formula =AND($A2="KTE", $B2>100)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations