Thứ Tư, 15 tháng 5, 2013

Định dạng ô dữ liệu theo điều kiện (sử dụng nhiều điều kiện) - Conditional formatting using multiple conditions - Excel 2007


Sử dụng để định dạng một ô dữ liệu tùy theo giá trị nhập vào ô đó.
Ví dụ: nếu nhập vào là 1 ô sẽ tự định dạng Fill màu đỏ, nhập vào 3 sẽ là màu xanh ....

Today I had a requirement to colour code in Excel based on a few conditions.  At first I thouhgt I could use thre to four rules in the conditional formatting to achieve this result but when I did that the results that I was getting was not very satisfactory.  So I thought I would try the And function of excel in conjunction with the conditional formatting and it worked wonders.
I wanted the entire row to be highlighted in a certain colour based on three conditions.
Here are the steps I followed to achieve what I was after.
  • Select all the data that you want to colour code. (Chọn toàn bộ khu vực dữ liệu bạn muốn đặt định dạng bằng màu sắc)
  • Click on Conditional Formating on the Home Tab (Click chuột vào "Conditional Formating" trên thẻ Home
  • Choose Manage Rules as shown below (Chọn "Manage Rules" như hình dưới)
Manage Rules
  • From the dialog that appears click New Rule Xuất hiện hộp thoại, click "New Rule"
  • Add the multiple conditions using the And function in the formula box. Thêm các điều kiện 
  • The most important thing you need to do when you are adding the formula to highlight rows is to remove the $ sign that gets assigned when you choose the cell for entering a formula with a mouse.
  • Choose the colour by clicking the format button and click ok
  • Click Ok again to come out of the Manage Rules window.
  • As you can see below I have added two rules and it is giving me the result that I want.

formula

This trick I am sure can be used in the Business Intelligence world when your interface is Excel.

Không có nhận xét nào:

Đăng nhận xét