Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Can I use a formula that finds the smallest number that occurs twice in a column?

I have a spreadsheet with a lengthy list of numbers. I need to find
the smallest number that occurs twice. I also need to find the
smallest number that occurs three times, etc. Is there a way to do
this with a formula?

I don't mind running a macro to do this, but I would need help with
that as well. Placing the answer in a msgbox is fine with me.

thanks in advance.
jasonk

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Can I use a formula that finds the smallest number that occurs twice in a column?

Try this Array formula (validate with Ctrl+Shift+Enter)
=MIN(A1:A999+IF(COUNTIF(A1:A999,A1:A999)=2,0,1E+23 9))

HTH
--
AP

"JasonK" a écrit dans le message de
...
I have a spreadsheet with a lengthy list of numbers. I need to find
the smallest number that occurs twice. I also need to find the
smallest number that occurs three times, etc. Is there a way to do
this with a formula?

I don't mind running a macro to do this, but I would need help with
that as well. Placing the answer in a msgbox is fine with me.

thanks in advance.
jasonk



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Can I use a formula that finds the smallest number that occurs twice in a column?

=MIN(IF(COUNTIF(A1:A20,A1:A20)=2,A1:A20))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

To change the number of occurrence, change the =2 value.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"JasonK" wrote in message
...
I have a spreadsheet with a lengthy list of numbers. I need to find
the smallest number that occurs twice. I also need to find the
smallest number that occurs three times, etc. Is there a way to do
this with a formula?

I don't mind running a macro to do this, but I would need help with
that as well. Placing the answer in a msgbox is fine with me.

thanks in advance.
jasonk



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Can I use a formula that finds the smallest number that occurs twice in a column?

=MIN(999,FALSE) returns 0, but your formula works as expected!

Regards,
--
AP


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Can I use a formula that finds the smallest number that occurs twice in a column?

Both formulas worked great when i altered the range to my sheet.
thanks guys. i wish i could learn this stuff quicker.
jasonk
unreal.

On Sat, 22 Apr 2006 11:15:04 +0200, "Ardus Petus"
wrote:

Try this Array formula (validate with Ctrl+Shift+Enter)
=MIN(A1:A999+IF(COUNTIF(A1:A999,A1:A999)=2,0,1E+2 39))

HTH


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
count number of instances a number occurs mark (plymouth) Excel Worksheet Functions 5 July 30th 08 04:05 PM
Count the number of times a name occurs in a column Gary Excel Worksheet Functions 2 December 28th 06 12:07 AM
The formula to find the smallest number in a row not equal to zero seastheday Excel Worksheet Functions 8 April 14th 05 11:58 PM
Which @function finds the mean of a number? Coffeecoco930 Excel Worksheet Functions 5 December 9th 04 03:11 AM
Find the smallest number in a column and change it to red C. Holstein Excel Programming 7 November 19th 03 05:57 AM


All times are GMT +1. The time now is 02:31 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"