# Need some MS Excel help please

**URL:** <https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542>\
**Category:** Factual Questions\
**Created:** [November 5, 2010, 2:59am UTC](https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542 "2010-11-05T02:59:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lumpy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lumpy/32/446_2.png) [@Lumpy](https://boards.straightdope.com/u/Lumpy)\
**Post date:** [November 5, 2010, 2:59am UTC](https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542/1 "2010-11-05T02:59:40Z")

</div>

I have a several-thousand line spreadsheet that includes a column of phone numbers. I need to confirm that none of the phone numbers are duplicates. Is there any alternative to entering each and every phone number manually in the Find search box? Is there any way to get Find to pick up the value of the currently selected cell as the search text?

---

<div class="post-metadata">

**Author:** ![Palooka](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/palooka/32/2902_2.png) [@Palooka](https://boards.straightdope.com/u/Palooka)\
**Post date:** [November 5, 2010, 3:09am UTC](https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542/2 "2010-11-05T03:09:31Z")

</div>

Insert a temporary column next to the phone numbers. Enter =COUNTIF(Col:Col, Cell) \> 1. Auto-fill everything. Sort for TRUE.

---

<div class="post-metadata">

**Author:** ![Martin\_Hyde](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@Martin\_Hyde](https://boards.straightdope.com/u/Martin_Hyde)\
**Post date:** [November 5, 2010, 3:12am UTC](https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542/3 "2010-11-05T03:12:45Z")

</div>

[Link](http://office.microsoft.com/en-us/excel-help/locate-duplicates-by-using-conditional-formatting-HA001136616.aspx) to a Microsoft article showing a solution to this in depth with pictures and etc.

---

<div class="post-metadata">

**Author:** ![Munch](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/munch/32/5281_2.png) [@Munch](https://boards.straightdope.com/u/Munch)\
**Post date:** [November 5, 2010, 3:15am UTC](https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542/4 "2010-11-05T03:15:24Z")

</div>

Yup. Let’s say you have 10 phone numbers going down Column A, starting with Row 1. Enter the following into B2:

=countif($a$2:$a$11, a2)

Drag that down column B. If there are any non 1s, then you have duplicates.

---

<div class="post-metadata">

**Author:** ![aceplace57](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/aceplace57/32/3500_2.png) [@aceplace57](https://boards.straightdope.com/u/aceplace57)\
**Post date:** [November 5, 2010, 3:16am UTC](https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542/5 "2010-11-05T03:16:53Z")

</div>

I usually sort on the field I’m checking for Duplicates. Then look through the list. The dups are usually easy to spot.

There are times the dups can’t be found with code. A Street Address. 12 Elm Street and 12 Elm St You’ll spot it easily in a sorted list.

The Microsoft article sounds interesting. I need to look at that myself.

---

<div class="post-metadata">

**Author:** ![penultima\_thule](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/penultima_thule/32/3833_2.png) [@penultima\_thule](https://boards.straightdope.com/u/penultima_thule)\
**Post date:** [November 5, 2010, 3:27am UTC](https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542/6 "2010-11-05T03:27:20Z")

</div>

A couple of alternatives:

Use a pivot table, categoried by number, sorted by descending count.

Use conditional formatting, highlighting any cell which is equal to the cell above

---

<div class="post-metadata">

**Author:** ![Martin\_Hyde](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@Martin\_Hyde](https://boards.straightdope.com/u/Martin_Hyde)\
**Post date:** [November 5, 2010, 3:33am UTC](https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542/7 "2010-11-05T03:33:04Z")

</div>

Or my favorite options when you’re talking about a dataset being stored in excel that is thousands of rows long:

Store it in a relational database where things like SELECT DISTINCT are trivial.

I understand that helps the OP not at all, but I do think it serves as a good example of a situation in which you may be better off using something other than spreadsheet technology. You can even still use Excel as the front end to a database if that was your inclination.

---

<div class="post-metadata">

**Author:** ![Hunter\_Hawk](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@Hunter\_Hawk](https://boards.straightdope.com/u/Hunter_Hawk)\
**Post date:** [November 5, 2010, 3:43am UTC](https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542/8 "2010-11-05T03:43:26Z")

</div>

In Excel 2010, there’s a handy-dandy command that will highlight duplicates using conditional formatting.

I haven’t attempted it, but if you don’t want to just scroll down and look for colors, I suspect you could then create a function that would enable you to automatically count the number of cells that match that formatting.

---

<div class="post-metadata">

**Author:** ![Projammer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/projammer/32/559_2.png) [@Projammer](https://boards.straightdope.com/u/Projammer)\
**Post date:** [November 5, 2010, 3:49am UTC](https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542/9 "2010-11-05T03:49:56Z")

</div>

I always use something like,

=IF(A2=A1,"\*","")

and drag copy it to the bottom of an empty column. Any row that has an \* is a duplicate.

ETA: To state the obvious, first sort the list by ph#.

---

<div class="post-metadata">

**Author:** ![Lumpy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lumpy/32/446_2.png) [@Lumpy](https://boards.straightdope.com/u/Lumpy)\
**Post date:** [November 5, 2010, 4:15pm UTC](https://boards.straightdope.com/t/need-some-ms-excel-help-please/559542/10 "2010-11-05T16:15:19Z")

</div>

> [@Projammer](#):
>
> I always use something like,
> 
> =IF(A2=A1,“\*”,“”)
> 
> and drag copy it to the bottom of an empty column. Any row that has an \* is a duplicate.
> 
> ETA: To state the obvious, first sort the list by ph#.

Oh right, sorting by phone# would put any duplicates next to each other. I’ll check out the suggestions given (I’m not experienced with functions so I’ll have to figure out how it works). Thanks all!
