Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 231
Default Conditional formatting with Rank

Hi there,

I have a column of data that changes regularly. I want to set up conditional
formatting whereby the top 5 datapoints show up in a different color to the
others. I think I have to use Rank for this but am not sure how?
Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Conditional formatting with Rank

1) I typed =RANDBETWEEN(1,100) in a10 and copied it down to A20
2) With A1:A20 selected, I use Conditional Format,; specified Formula Is
=RANK(A1,$A$1:$A$20)=1 and set colour red
3) I added =RANK(A1,$A$1:$A$20)=2 and set colour blue
4) I added =RANK(A1,$A$1:$A$20)=3 and set colour green

When I hit F9 to recalculate the formulas the colours move about as
required.
But you want 5 criteria and the maximum is 3 (until you get XL2007)
So you will need a macro, see
http://www.ozgrid.com/VBA/excel-cond...ting-limit.htm
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Sarah" wrote in message
...
Hi there,

I have a column of data that changes regularly. I want to set up
conditional
formatting whereby the top 5 datapoints show up in a different color to
the
others. I think I have to use Rank for this but am not sure how?
Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 231
Default Conditional formatting with Rank

Thanks - very helpful!

"Bernard Liengme" wrote:

1) I typed =RANDBETWEEN(1,100) in a10 and copied it down to A20
2) With A1:A20 selected, I use Conditional Format,; specified Formula Is
=RANK(A1,$A$1:$A$20)=1 and set colour red
3) I added =RANK(A1,$A$1:$A$20)=2 and set colour blue
4) I added =RANK(A1,$A$1:$A$20)=3 and set colour green

When I hit F9 to recalculate the formulas the colours move about as
required.
But you want 5 criteria and the maximum is 3 (until you get XL2007)
So you will need a macro, see
http://www.ozgrid.com/VBA/excel-cond...ting-limit.htm
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Sarah" wrote in message
...
Hi there,

I have a column of data that changes regularly. I want to set up
conditional
formatting whereby the top 5 datapoints show up in a different color to
the
others. I think I have to use Rank for this but am not sure how?
Thanks!




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 303
Default Conditional formatting with Rank

No answers yet,,,, so I assume that it is rather difficult or impossible
with conditional formatting.

The other way to do it is with a macro.

This macro will insert a column next to the data column, and fill the new
temporary column (B) with a range
from 1 to 1000.
then it will sort the original data (here in column A)
highlight the top five cells
re-sort the data by the new column B to get the A column back
into the normal unsorted order and
then it will delete the temporary column B.

If you have problems with the use of the macro send me an email direct.

Sub Macro3()

Range("B1").Select
Selection.EntireColumn.Insert
Range("B1").Select
ActiveCell.FormulaR1C1 = "1"
Range("B1").Select
Selection.AutoFill Destination:=Range("B1:B1000"), Type:=xlFillSeries
Range("B1:B1000").Select
Range("A1:B1000").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A1:A5").Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Range("A1:B1000").Select
Selection.Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("B1").Select
Selection.EntireColumn.Delete
Range("A1").Select
End Sub
--
Greetings from New Zealand

"Sarah" wrote in message
...
Hi there,

I have a column of data that changes regularly. I want to set up
conditional
formatting whereby the top 5 datapoints show up in a different color to
the
others. I think I have to use Rank for this but am not sure how?
Thanks!



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
RANK, duplicate ranking but no gaps in rank arron laing Excel Worksheet Functions 4 June 14th 06 07:57 AM
Conditional Format Rank query Rich Excel Discussion (Misc queries) 3 June 12th 06 07:43 PM
Rank where lowest value is highest rank mile3024 Excel Worksheet Functions 2 December 9th 05 10:57 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM
Rank items, select one start date, have remaining dates follow based on rank rob normerica Excel Discussion (Misc queries) 1 August 15th 05 09:36 PM


All times are GMT +1. The time now is 11:28 AM.

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

About Us

"It's about Microsoft Excel"