Cell coloring when the value is an integer and within said range

  • Thread starter Thread starter Bala
  • Start date Start date
B

Bala

Hi,
I want to control the cell colour using conditional formatting feature. Or
please advise me if I have to essentially write a macro.
My requirement is that. a cell can assume values 0 to 150.

a. when the cell value has a decimal precision (i.e, 10.01, 100.01 etc) then
cell should turn amber
b. when cell value is an integer and lies between 80 and 100 then the cell
should turn green
c. when the cell value is an integer and greater than 100 then the cell
should change red
 
Select the cell that you want to format. Assume this is cell A1.

Goto the menu Format>Conditional Formatting
Condition 1
Formula Is: =MOD(A1,1)
Click the Format button
Select the Patterns tab
Select a nice shade of YELLOW
OK
Click the Add button

Condition 2
Formula Is: =AND(INT(A1)=A1,A1>=80,A1<=100)
Click the Format button
Select the Patterns tab
Select a nice shade of GREEN
OK
Click the Add button

Condition 3
Formula Is: =AND(INT(A1)=A1,A1>100)
Click the Format button
Select the Patterns tab
Select a nice shade of RED
OK out
 
Hi Valko,
It was very useful. Thank You.

T. Valko said:
Select the cell that you want to format. Assume this is cell A1.

Goto the menu Format>Conditional Formatting
Condition 1
Formula Is: =MOD(A1,1)
Click the Format button
Select the Patterns tab
Select a nice shade of YELLOW
OK
Click the Add button

Condition 2
Formula Is: =AND(INT(A1)=A1,A1>=80,A1<=100)
Click the Format button
Select the Patterns tab
Select a nice shade of GREEN
OK
Click the Add button

Condition 3
Formula Is: =AND(INT(A1)=A1,A1>100)
Click the Format button
Select the Patterns tab
Select a nice shade of RED
OK out
 
Back
Top