Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JRD JRD is offline
external usenet poster
 
Posts: 60
Default Duplication of string values within a range

How do I check whether the same string value appears within a range of cells

e.g.

A
1 JD
2 DF
3 AM
4 FC
5 RS
6 DF
7 JD

How do I get excel to check down column A1:A7 to see if any of the different
strings are repeated? In this example I want to return the answer "yes"
because JD appears in both A1 and A7. However, if this wasn't the case then I
would want excel to return the answer "no"

I am using excel 2007

Many thanks

JD


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,203
Default Duplication of string values within a range

In B1, or another available cell on row 1, enter this formula:
=IF(COUNTIF(A$1:A$7,A1)1,"YES","NO")
Fill the formula down to the end of the list in column A. Change the A$7
part to use the last row number for your list in column A.
Duplicate/multiple entries will be identified as "YES" until you remove all
but 1 of them for all entries. That is, you will get YES at row 1 and 7
until one of the JD entries is removed.

"JRD" wrote:

How do I check whether the same string value appears within a range of cells

e.g.

A
1 JD
2 DF
3 AM
4 FC
5 RS
6 DF
7 JD

How do I get excel to check down column A1:A7 to see if any of the different
strings are repeated? In this example I want to return the answer "yes"
because JD appears in both A1 and A7. However, if this wasn't the case then I
would want excel to return the answer "no"

I am using excel 2007

Many thanks

JD


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Duplication of string values within a range

Assuming there are no empty cells within in the range:

=IF(SUMPRODUCT(COUNTIF(A1:A7,A1:A7))=ROWS(A1:A7)," Yes","No")

--
Biff
Microsoft Excel MVP


"JRD" wrote in message
...
How do I check whether the same string value appears within a range of
cells

e.g.

A
1 JD
2 DF
3 AM
4 FC
5 RS
6 DF
7 JD

How do I get excel to check down column A1:A7 to see if any of the
different
strings are repeated? In this example I want to return the answer "yes"
because JD appears in both A1 and A7. However, if this wasn't the case
then I
would want excel to return the answer "no"

I am using excel 2007

Many thanks

JD




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Duplication of string values within a range

=IF(SUMPRODUCT(COUNTIF(A1:A7,A1:A7))=ROWS(A1:A7), "Yes","No")

Ooops! I think I have the Yes/No backwards. So, let's just change the
operator:

=IF(SUMPRODUCT(COUNTIF(A1:A7,A1:A7))ROWS(A1:A7)," Yes","No")

Yes = there are duplicates
No = there are no duplicates


--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Assuming there are no empty cells within in the range:

=IF(SUMPRODUCT(COUNTIF(A1:A7,A1:A7))=ROWS(A1:A7)," Yes","No")

--
Biff
Microsoft Excel MVP


"JRD" wrote in message
...
How do I check whether the same string value appears within a range of
cells

e.g.

A
1 JD
2 DF
3 AM
4 FC
5 RS
6 DF
7 JD

How do I get excel to check down column A1:A7 to see if any of the
different
strings are repeated? In this example I want to return the answer "yes"
because JD appears in both A1 and A7. However, if this wasn't the case
then I
would want excel to return the answer "no"

I am using excel 2007

Many thanks

JD






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Duplication of string values within a range

On Fri, 26 Jun 2009 06:40:01 -0700, JRD wrote:

How do I check whether the same string value appears within a range of cells

e.g.

A
1 JD
2 DF
3 AM
4 FC
5 RS
6 DF
7 JD

How do I get excel to check down column A1:A7 to see if any of the different
strings are repeated? In this example I want to return the answer "yes"
because JD appears in both A1 and A7. However, if this wasn't the case then I
would want excel to return the answer "no"

I am using excel 2007

Many thanks

JD



This formula must be **array-entered**:

=IF(OR(COUNTIF(A1:A7,A1:A7)1),"Yes","No")
----------------------------------------

To **array-enter** a formula, after entering
the formula into the cell or formula bar, hold down
<ctrl<shift while hitting <enter. If you did this
correctly, Excel will place braces {...} around the formula.

--ron
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
Sum values in string in a cell Francis[_2_] Excel Worksheet Functions 12 May 9th 09 02:15 AM
Return a String in a 7 Row Range Q Sean Excel Worksheet Functions 6 October 6th 08 03:36 PM
convert a string to range? JK Excel Worksheet Functions 4 June 20th 06 01:04 AM
specify range name in formula with concatenated string Lori H Excel Worksheet Functions 2 July 19th 05 03:07 PM
Stop Number duplication in a range Nu-bEE Excel Discussion (Misc queries) 5 March 21st 05 04:23 PM


All times are GMT +1. The time now is 04:09 PM.

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"