Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default If statements, conditions and cell display

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

I have the formulas:

Formula is: =AND(B2-A2<=0,B2<"",A2<"")
Format: Red fill ( and I have for Amber and green)

Which work fine.

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
can't use that 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 and 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default If statements, conditions and cell display

=AND(OR(LEFT(B2,1)LEFT(A2,1),AND(LEFT(B2,1)=LEFT (A2,1),RIGHT(B2,1)<RIGHT(A2,1))),B2<"",A2<"")

will tell you if B2 is greater than A2. You should be able to adapt to
equal and less than.

--
Regards,
Tom Ogilvy



"Maliya9" wrote in message
...
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

I have the formulas:

Formula is: =AND(B2-A2<=0,B2<"",A2<"")
Format: Red fill ( and I have for Amber and green)

Which work fine.

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
can't use that 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 and 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default If statements, conditions and cell display

Thank you, but it doesn't seem to be working. I put the formula into
conditional formatting so I could do the colours. the results were
inconsistent. any ideas please?

"Tom Ogilvy" wrote:

=AND(OR(LEFT(B2,1)LEFT(A2,1),AND(LEFT(B2,1)=LEFT (A2,1),RIGHT(B2,1)<RIGHT(A2,1))),B2<"",A2<"")

will tell you if B2 is greater than A2. You should be able to adapt to
equal and less than.

--
Regards,
Tom Ogilvy



"Maliya9" wrote in message
...
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

I have the formulas:

Formula is: =AND(B2-A2<=0,B2<"",A2<"")
Format: Red fill ( and I have for Amber and green)

Which work fine.

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
can't use that 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 and 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a cell display blank under certain conditions? DS2005 Excel Discussion (Misc queries) 2 December 17th 09 11:22 PM
if conditions, and statements Cinnabonns Excel Discussion (Misc queries) 1 October 5th 09 05:07 AM
if conditions in 2 cell correct then display third cell Paul Hood New Users to Excel 3 January 21st 09 07:30 AM
conditions in if statements Roy Gudgeon[_2_] Excel Discussion (Misc queries) 1 June 30th 08 01:43 PM
Sum if statements with conditions La Donna Excel Worksheet Functions 2 June 20th 05 01:14 PM


All times are GMT +1. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"