ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF statements and conditions (https://www.excelbanter.com/excel-worksheet-functions/124308-if-statements-conditions.html)

Maliya9

IF statements and conditions
 
I don't even know if its IF statements I want!

I want Excel to background colour a cell, Red, Amber or Green dependent upon
the data in it compared to the data in the cell immediately left of it.

e.g. if the data is equal, or lower value = red
if the data is higher by 1 = amber
if the data is higher by 2+ = green

Can anybody help? it'll be much appreciated!

Stefi

IF statements and conditions
 
Have a look at Formats/Conditional formatting!

Regards,
Stefi


€˛Maliya9€¯ ezt Ć*rta:

I don't even know if its IF statements I want!

I want Excel to background colour a cell, Red, Amber or Green dependent upon
the data in it compared to the data in the cell immediately left of it.

e.g. if the data is equal, or lower value = red
if the data is higher by 1 = amber
if the data is higher by 2+ = green

Can anybody help? it'll be much appreciated!


Max

IF statements and conditions
 
Here's a play you can try out ..

Assuming the numbers to be conditionally formatted are in say, B2:B20
(to be compared with immediate left adjacent numbers in A2:A20)

Select B2:B20

Click Format Conditional Formatting

Under Condition 1:
Formula is: =AND(B2-A2<=0,B2<"",A2<"")
Format: Red fill

Under Condition 2:
Formula is: =AND(B2-A20,B2-A2<2,B2<"",A2<"")
Format: Amber fill

Under Condition 3:
Formula is: =AND(B2-A2=2,B2<"",A2<"")
Format: Green fill

Click to OK out.

Test it out ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Maliya9" wrote:
I don't even know if its IF statements I want!

I want Excel to background colour a cell, Red, Amber or Green dependent upon
the data in it compared to the data in the cell immediately left of it.

e.g. if the data is equal, or lower value = red
if the data is higher by 1 = amber
if the data is higher by 2+ = green

Can anybody help? it'll be much appreciated!


Maliya9

IF statements and conditions
 
Hey Max, thanks for your help.

The formulas you gave ie

Formula is: =AND(B2-A2<=0,B2<"",A2<"")
Format: Red fill

worked fine. thank you.
Now my prob is my data is not all numerical, ie it runs
6a,6b,6c....to...1a,1b,1c where 6a is highest and 1c is lowest. So excel
cna't use formula where letters are involved. I can change the 1c, 1b etc
into average point scores instead. i.e 1c=7, 1b=9,1a=11 etc. But I wanted
Excel to do it so if a member of my staff types in 1c, the cell displays 7
adn if they type in 4a the cell will display 29 etc. I tried autocorrect, but
every cell needs every possibility...does this make sense? Really appreciate
your help. - Bob


"Max" wrote:

Here's a play you can try out ..

Assuming the numbers to be conditionally formatted are in say, B2:B20
(to be compared with immediate left adjacent numbers in A2:A20)

Select B2:B20

Click Format Conditional Formatting

Under Condition 1:
Formula is: =AND(B2-A2<=0,B2<"",A2<"")
Format: Red fill

Under Condition 2:
Formula is: =AND(B2-A20,B2-A2<2,B2<"",A2<"")
Format: Amber fill

Under Condition 3:
Formula is: =AND(B2-A2=2,B2<"",A2<"")
Format: Green fill

Click to OK out.

Test it out ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Maliya9" wrote:
I don't even know if its IF statements I want!

I want Excel to background colour a cell, Red, Amber or Green dependent upon
the data in it compared to the data in the cell immediately left of it.

e.g. if the data is equal, or lower value = red
if the data is higher by 1 = amber
if the data is higher by 2+ = green

Can anybody help? it'll be much appreciated!


Max

IF statements and conditions
 
"Maliya9" wrote:
Hey Max, thanks for your help...


You're welcome

.. But I wanted Excel to do it
so if a member of my staff types in 1c,
the cell displays 7
and if they type in 4a the cell will display 29 etc...


Think you would need a sub to do the above. Suggest you try a fresh posting
in excel.programming to garner responses from those versed in vba.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---




All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com