Can I use a formula that finds the smallest number that occurs twice in a column?

  • Thread starter Thread starter JasonK
  • Start date Start date
J

JasonK

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
 
Try this Array formula (validate with Ctrl+Shift+Enter)
=MIN(A1:A999+IF(COUNTIF(A1:A999,A1:A999)=2,0,1E+239))

HTH
 
=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)
 
Both formulas worked great when i altered the range to my sheet.
thanks guys. i wish i could learn this stuff quicker.
jasonk
unreal.
 

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