Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Si
 
Posts: n/a
Default How to get nth distict value in a column

Hi,

Is there anyone clever enough to know how to work this out?
I've got a column with a list of data. In a summary I'd like to be
able to get a distinct list from the column.

So from the following source data:

Column
-----------
IB3\SJ16
IB3\SJ16
IB3\SJ16
SJ17
SJ17
IB3
IB3\SJ16
Verdi
SJ17
Tax Certs
Verdi
Verdi

I'd like to be able to get

Summary Column
-------------
IB3\SJ16
SJ17
IB3
Verdi
Tax Certs

I've tried playing with the various LOOKUP functions but this has got
me stumped. Can anyone point in the direction on how to get this
working.

Many thanks
Si

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default How to get nth distict value in a column

Use Data-Filter-Advanced Filter

Select "Copy to another location" and indicate the range to copy to in the
bottom edit box, then be sure to check "Unique records only"


"Si" wrote:

Hi,

Is there anyone clever enough to know how to work this out?
I've got a column with a list of data. In a summary I'd like to be
able to get a distinct list from the column.

So from the following source data:

Column
-----------
IB3\SJ16
IB3\SJ16
IB3\SJ16
SJ17
SJ17
IB3
IB3\SJ16
Verdi
SJ17
Tax Certs
Verdi
Verdi

I'd like to be able to get

Summary Column
-------------
IB3\SJ16
SJ17
IB3
Verdi
Tax Certs

I've tried playing with the various LOOKUP functions but this has got
me stumped. Can anyone point in the direction on how to get this
working.

Many thanks
Si


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default How to get nth distict value in a column

In B1: =A1
In B2: =IF(ISERROR(MATCH(0,COUNTIF(B$1:B1,$A$1:$A$20&""), 0)),"",
INDEX(IF(ISBLANK($A$1:$A$20),"",$A$1:$A$20),MATCH( 0,COUNTIF(B$1:B1,$A$1:$A$2
0&""),0)))

which is an array formula, so commit with Ctrl-Shift-Enter

Copy B2 down.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Si" wrote in message
oups.com...
Hi,

Is there anyone clever enough to know how to work this out?
I've got a column with a list of data. In a summary I'd like to be
able to get a distinct list from the column.

So from the following source data:

Column
-----------
IB3\SJ16
IB3\SJ16
IB3\SJ16
SJ17
SJ17
IB3
IB3\SJ16
Verdi
SJ17
Tax Certs
Verdi
Verdi

I'd like to be able to get

Summary Column
-------------
IB3\SJ16
SJ17
IB3
Verdi
Tax Certs

I've tried playing with the various LOOKUP functions but this has got
me stumped. Can anyone point in the direction on how to get this
working.

Many thanks
Si



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Si
 
Posts: n/a
Default How to get nth distict value in a column

Thanks Bob, this is exactly what I was looking for and it works a
treat!

Thanks for your time Duke, but I was hoping for a function.

Cheers
Si

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
topola
 
Posts: n/a
Default How to get nth distict value in a column

Beautiful! I didn't supposed it could be done so easily. Well done
Bob! topola



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default How to get nth distict value in a column

The good thing about this is that if you change a value in the source data,
the target data is automatically updated.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Si" wrote in message
oups.com...
Thanks Bob, this is exactly what I was looking for and it works a
treat!

Thanks for your time Duke, but I was hoping for a function.

Cheers
Si



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Herbert Seidenberg
 
Posts: n/a
Default How to get nth distict value in a column

This might appeal to beginners.
Highlight all duplicate cells in your list with conditional formatting,
then delete those cells.
Use R1C1, then switch back to A1.
Insert Name Create or Define (say ListA)
Conditional Formatting Formula Is
=MATCH(RC,ListA,0)<(ROW()-ROW(ListA)+1)

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default How to get nth distict value in a column

Bob Phillips wrote...
In B1: =A1
In B2: =IF(ISERROR(MATCH(0,COUNTIF(B$1:B1,$A$1:$A$20&""), 0)),"",
INDEX(IF(ISBLANK($A$1:$A$20),"",$A$1:$A$20),
MATCH(0,COUNTIF(B$1:B1,$A$1:$A$20&""),0)))

....

Compact form

B2:
=IF(SUM(COUNTIF(B$1:B1,A$1:A$20))<COUNTA(A$1:A$20) ,
INDEX(A$1:A$20,MATCH(0,COUNTIF(B$1:B1,A$1:A$20),0) ),"")

As for the general question of the n_th distinct value in a list (LST),

=INDEX(LST,SMALL(IF(MATCH(LST,LST,0)=ROW(LST)-ROW(INDEX(LST,1,1))+1,
MATCH(LST,LST,0)),n))

also an array formula.

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
Check COlumn - Excel VBA magix Excel Discussion (Misc queries) 11 November 5th 05 02:32 AM
creating a bar graph Johnfli Excel Discussion (Misc queries) 0 October 26th 05 08:16 PM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 8 May 18th 05 04:23 AM
How to group similar column titles together???? vrk1 Excel Discussion (Misc queries) 2 April 30th 05 12:17 AM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


All times are GMT +1. The time now is 03:02 AM.

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"