3 highest values indicated using formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to highlight the 3 highest numbers in a column - a different color
for each high number. I figured I'd use conditional formatting and LARGE, but
there are duplicate numbers, which should all be highlighted.

Also is there a limit on the length of a formula?

Thanks!!!!
 
Hi!

This is pretty tough and I couldn't figure out how to do it without the use
of a helper coulmn .....

Assume your values are in the range A1:A20.

In a helper column (I'll use column B) enter this formula with the key combo
of CTRL,SHIFT,ENTER in cell B2. Cell B1 MUST be empty:

=IF(ISERROR(MATCH(0,COUNTIF($B$1:B1,$A$1:$A$20),0)),0,INDEX($A$1:$A$20,MATCH(0,COUNTIF($B$1:B1,$A$1:$A$20),0)))

Copy down to B21

This will extract the unique values from column A, A1:A20.

Now, you can base the cf on those extracted values.

Select the range A1:A20
Goto Format>Conditional Formatting

Condition 1
Formula is: =A1=LARGE(B$2:B$21,1)
Select your desired format style

Click ADD

Condition 2
Formula is: =A1=LARGE(B$2:B$21,2)
Select your desired format style

Click ADD

Condition 3
Formula is: =A1=LARGE(B$2:B$21,3)
Select your desired format style

OK out
Also is there a limit on the length of a formula?

For a worksheet cell the max length is 1024 chars. For those formula boxes
in user forms like the one you will use for the cf, I think the length limit
is 255 chars.

Biff
 
I'd like to highlight the 3 highest numbers in a column - a different color
for each high number. I figured I'd use conditional formatting and LARGE, but
there are duplicate numbers, which should all be highlighted.

Also is there a limit on the length of a formula?

Thanks!!!!

What do you want to happen in the event of duplicate numbers?


--ron
 
Duplicate numbers should all have the same format, ie all the highest #'s are
red, the second highest #'s are all blue, etc...
 
Easiest solution I guess would be to get the 3 largest values in a sepaprate
area in worksheet and do conditional formatting by referenceing to it
say you insert these 3 largest values in Z1,z2 and z3 (assuming that your
data is in a1:a1000)

For largest on cell Z1 type
=Max(a1:a1000)

On Z2 (2nd largest )
=max(if(a1:a1000<z1,a1:a1000))
array entered (ctrl+shift+enter)

On Z3 (for 3rd largest)
=max(if(a1:a1000<z2,a1:a1000))
array entered (ctrl+shift+enter)
 
Duplicate numbers should all have the same format, ie all the highest #'s are
red, the second highest #'s are all blue, etc...

See N Harkawat's solution later in this thread.
--ron
 
Hey thanks, worked great!!!

N Harkawat said:
Easiest solution I guess would be to get the 3 largest values in a sepaprate
area in worksheet and do conditional formatting by referenceing to it
say you insert these 3 largest values in Z1,z2 and z3 (assuming that your
data is in a1:a1000)

For largest on cell Z1 type
=Max(a1:a1000)

On Z2 (2nd largest )
=max(if(a1:a1000<z1,a1:a1000))
array entered (ctrl+shift+enter)

On Z3 (for 3rd largest)
=max(if(a1:a1000<z2,a1:a1000))
array entered (ctrl+shift+enter)
 

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

Back
Top