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

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
 
T

T. Valko

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
 
B

Bala

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top