A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Find Smallest and Largest.



 
 
Thread Tools Display Modes
  #1  
Old October 9th, 2007, 07:48 PM posted to microsoft.public.excel.worksheet.functions
dlbeiler
external usenet poster
 
Posts: 14
Default Find Smallest and Largest.

I have a column of random numbers and need to find the smallest, second
smallest, third smallest, third largest, second largest, largest and
highlight these numbers with different font colors.
  #2  
Old October 9th, 2007, 07:56 PM posted to microsoft.public.excel.worksheet.functions
Don Guillett
external usenet poster
 
Posts: 6,167
Default Find Smallest and Largest.

You might try looking in the help index for SMALL

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"dlbeiler" wrote in message
...
I have a column of random numbers and need to find the smallest, second
smallest, third smallest, third largest, second largest, largest and
highlight these numbers with different font colors.


  #3  
Old October 9th, 2007, 08:57 PM posted to microsoft.public.excel.worksheet.functions
ilia
external usenet poster
 
Posts: 142
Default Find Smallest and Largest.

Use conditional formatting. Unfortunately if you have Excel 2003 or
earlier, you can only set 3 rules, meaning 3 different colors.

Select the entire range, activate first cell. My example is a list of
random numbers in cells A1:A42. I select the entire range, and
activate A1.

Then, in conditional formatting dialog box use "Formula is" and type
in this:

=A1=SMALL($A$1:$A$42,1)

This will return TRUE for the smallest number in range. Select
Format, and choose a different font color.

For second smallest number, use this "Formula is" rule:

=A1=SMALL($A$1:$A$42,2)

The opposite of this is the LARGE() function. Largest number in range
will be found like this:

=A1=LARGE($A$1:$A$42,1)

Once you've made up the rules, recalc a few times to ensure you are
getting the correct behavior.


On Oct 9, 2:48 pm, dlbeiler
wrote:
I have a column of random numbers and need to find the smallest, second
smallest, third smallest, third largest, second largest, largest and
highlight these numbers with different font colors.



  #4  
Old October 10th, 2007, 06:30 AM posted to microsoft.public.excel.worksheet.functions
dlbeiler
external usenet poster
 
Posts: 14
Default Find Smallest and Largest.

Thank you for your response. I am using Excel 2000 and am limited to 3
rules. In that case, would it be possible to combine the smallest, second
smallest and third smallest into one rule and thus use the same font color to
identify all three?

"ilia" wrote:

Use conditional formatting. Unfortunately if you have Excel 2003 or
earlier, you can only set 3 rules, meaning 3 different colors.

Select the entire range, activate first cell. My example is a list of
random numbers in cells A1:A42. I select the entire range, and
activate A1.

Then, in conditional formatting dialog box use "Formula is" and type
in this:

=A1=SMALL($A$1:$A$42,1)

This will return TRUE for the smallest number in range. Select
Format, and choose a different font color.

For second smallest number, use this "Formula is" rule:

=A1=SMALL($A$1:$A$42,2)

The opposite of this is the LARGE() function. Largest number in range
will be found like this:

=A1=LARGE($A$1:$A$42,1)

Once you've made up the rules, recalc a few times to ensure you are
getting the correct behavior.


On Oct 9, 2:48 pm, dlbeiler
wrote:
I have a column of random numbers and need to find the smallest, second
smallest, third smallest, third largest, second largest, largest and
highlight these numbers with different font colors.




  #5  
Old October 10th, 2007, 01:19 PM posted to microsoft.public.excel.worksheet.functions
Don Guillett
external usenet poster
 
Posts: 6,167
Default Find Smallest and Largest.

Try this idea for condition 1. Add small,2 in the middle.
=OR(O3=SMALL($O$2:$O$8,1),O2=SMALL($O2:$O8,3))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"dlbeiler" wrote in message
...
I have a column of random numbers and need to find the smallest, second
smallest, third smallest, third largest, second largest, largest and
highlight these numbers with different font colors.


  #6  
Old October 10th, 2007, 02:16 PM posted to microsoft.public.excel.worksheet.functions
Don Guillett
external usenet poster
 
Posts: 6,167
Default Find Smallest and Largest.

Or 6 different colors if 6 different values. ie: three smallest the same =
color 34

Sub colorsmallest()
Set Rng = Range("p218")
For Each c In Rng
Select Case c.Value
Case Application.Small(Rng, 1): mc = 34
Case Application.Small(Rng, 2): mc = 35
Case Application.Small(Rng, 3): mc = 36
Case Application.Large(Rng, 1): mc = 37
Case Application.Large(Rng, 2): mc = 38
Case Application.Large(Rng, 3): mc = 39
Case Else
mc = 0
End Select
If IsNumeric(c) Then c.Interior.ColorIndex = mc
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
Try this idea for condition 1. Add small,2 in the middle.
=OR(O3=SMALL($O$2:$O$8,1),O2=SMALL($O2:$O8,3))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"dlbeiler" wrote in message
...
I have a column of random numbers and need to find the smallest, second
smallest, third smallest, third largest, second largest, largest and
highlight these numbers with different font colors.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:41 PM.


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