Forum Discussion

Kenneth Green's avatar
Kenneth Green
Brass Contributor
Mar 22, 2024

Formula look at range of cells in colum, find duplicates & return the the dup that appears the most.

Windows 10

Excell 2029

 

I need a formula that looks at cells in a range, finds any duplicate and returns the duplicate that appears the most.

An example would be

Column A

Butter

Milk

Butter

Butter

Bread

Banana

 

and the formula result would be Butter in Cell C2

I already have the code that looks at Column A and I have marked where the 2nd formula would be.

Either version of the formula is entered into C2 and looks at cell A2.
If A2 is NOT null then the formula that I am looking for would run
and return the result in C2

 

A1 Format

 

 

'=IF(A2="","","Code Goes Here")

 

 

 

R1C1 Format

 

 

Range("C2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-2]="""","""",""Code Goes Here"")"

 

 

 

Thank you in advance 

Resources