PDA

View Full Version : Formula To Identify A Cell Has Duplicate Words



Admin
07-03-2011, 05:52 AM
Hi All,

Here is a method which gives 1 or 0 if a cell has duplicate word(s) in it.

I hope this helps you !

Enjoy !!

<b>Sheet1</b><br /><br /><table border="1" cellspacing="0" cellpadding="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:131px;" /><col style="width:64px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td >*</td><td >A</td><td >B</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td >vista mac vista</td><td style="text-align:right; ">1</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td >windows linux</td><td style="text-align:right; ">0</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td >excel word excel</td><td style="text-align:right; ">1</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td >excel fox den of fox</td><td style="text-align:right; ">1</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td >admin excelfox</td><td style="text-align:right; ">0</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td >one two one one</td><td style="text-align:right; ">1</td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b>Spreadsheet Formulas</b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >B1</td><td >=SUMPRODUCT(--<span style=' color:008000; '>(FREQUENCY<span style=' color:#0000ff; '>(MATCH<span style=' color:#ff0000; '>(String,String,0)</span>,ROW<span style=' color:#ff0000; '>(INDEX<span style=' color:#804000; '>(A:A,1)</span>:INDEX<span style=' color:#804000; '>(A:A,COUNTA<span style=' color:#ff7837; '>(String)</span>)</span>)</span>)</span>>1)</span>)</td></tr><tr><td >B2</td><td >=SUMPRODUCT(--<span style=' color:008000; '>(FREQUENCY<span style=' color:#0000ff; '>(MATCH<span style=' color:#ff0000; '>(String,String,0)</span>,ROW<span style=' color:#ff0000; '>(INDEX<span style=' color:#804000; '>(A:A,1)</span>:INDEX<span style=' color:#804000; '>(A:A,COUNTA<span style=' color:#ff7837; '>(String)</span>)</span>)</span>)</span>>1)</span>)</td></tr><tr><td >B3</td><td >=SUMPRODUCT(--<span style=' color:008000; '>(FREQUENCY<span style=' color:#0000ff; '>(MATCH<span style=' color:#ff0000; '>(String,String,0)</span>,ROW<span style=' color:#ff0000; '>(INDEX<span style=' color:#804000; '>(A:A,1)</span>:INDEX<span style=' color:#804000; '>(A:A,COUNTA<span style=' color:#ff7837; '>(String)</span>)</span>)</span>)</span>>1)</span>)</td></tr><tr><td >B4</td><td >=SUMPRODUCT(--<span style=' color:008000; '>(FREQUENCY<span style=' color:#0000ff; '>(MATCH<span style=' color:#ff0000; '>(String,String,0)</span>,ROW<span style=' color:#ff0000; '>(INDEX<span style=' color:#804000; '>(A:A,1)</span>:INDEX<span style=' color:#804000; '>(A:A,COUNTA<span style=' color:#ff7837; '>(String)</span>)</span>)</span>)</span>>1)</span>)</td></tr><tr><td >B5</td><td >=SUMPRODUCT(--<span style=' color:008000; '>(FREQUENCY<span style=' color:#0000ff; '>(MATCH<span style=' color:#ff0000; '>(String,String,0)</span>,ROW<span style=' color:#ff0000; '>(INDEX<span style=' color:#804000; '>(A:A,1)</span>:INDEX<span style=' color:#804000; '>(A:A,COUNTA<span style=' color:#ff7837; '>(String)</span>)</span>)</span>)</span>>1)</span>)</td></tr><tr><td >B6</td><td >=SUMPRODUCT(--<span style=' color:008000; '>(FREQUENCY<span style=' color:#0000ff; '>(MATCH<span style=' color:#ff0000; '>(String,String,0)</span>,ROW<span style=' color:#ff0000; '>(INDEX<span style=' color:#804000; '>(A:A,1)</span>:INDEX<span style=' color:#804000; '>(A:A,COUNTA<span style=' color:#ff7837; '>(String)</span>)</span>)</span>)</span>>1)</span>)</td></tr></table></td></tr></table><br /><br /><b>Sheet1</b><br /><br /><table border="1" cellspacing="0" cellpadding="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:64px;" /><col style="width:392px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td >*</td><td >G</td><td >H</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td >*</td><td >To define 'String'</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td >*</td><td >Select A1(or whatever the cell your data starts)</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td >*</td><td >*</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td >String</td><td >=EVALUATE("{"""&SUBSTITUTE(Sheet1!$A1," ",""";""")&"""}")</td></tr></table> <br /><br /><span style="font-family:Arial; font-size:9pt; font-weight:bold;background-color:#ffffff; color:#000000; ">Excel tables to the web >> </span><a style ="font-family:Arial; font-size:9pt; color:#fcf507; background-color:#800040; font-weight:bold;" href="http://www.excel-jeanie-html.de/index.php?f=1" target="_blank"> Excel Jeanie HTML 4 </a>


Define String as

=EVALUATE("{"""&SUBSTITUTE(TRIM(Sheet1!$A1)," ",""";""")&"""}")