Formulas

%3CLINGO-SUB%20id%3D%22lingo-sub-905010%22%20slang%3D%22en-US%22%3EFormulas%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-905010%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20list%20of%20names%20where%20some%20recur.%20I%20trying%20to%20find%20a%20formula%20that%20will%20create%20a%20list%20of%20all%20the%20names%20but%20without%20the%20duplicates.%20Does%20this%20exist%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20so%20much%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDrew%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-905010%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-905052%22%20slang%3D%22en-US%22%3ERE%3A%20Formulas%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-905052%22%20slang%3D%22en-US%22%3EHello%20James.%20If%20you%20have%20Office%20365%2C%20Excel%20has%20a%20UNIQUE%20function.%20The%20UNIQUE%20function%20will%20extract%20a%20list%20of%20distinct%20values%20or%20unique%20values.%20Unique%20are%20values%20that%20occur%20only%20once.%20It%20sounds%20like%20you%20are%20looking%20for%20distinct%2C%20which%20it%20handles%20also.%20The%20UNIQUE%20function%20is%20a%20dynamic%20array%20function.%20Here%20is%20a%20video%20I%20created%20on%20how%20to%20use%20the%20function.%20%3CA%20href%3D%22https%3A%2F%2Fyoutu.be%2FP5QQPvDeFoo%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fyoutu.be%2FP5QQPvDeFoo%3C%2FA%3E%20If%20you%20didn't%20want%20to%20use%20a%20function%2C%20you%20could%20also%20Copy%20and%20Paste%20and%20use%20Remove%20Duplicates%20which%20is%20on%20the%20Data%20Tab%20under%20the%20group%20Data%20Tools.%20One%20last%20thing%20you%20could%20use%20is%20a%20PivotTable%20and%20use%20the%20Distinct%20function.%20Here%20is%20a%20video%20I%20created%20on%20that%20feature.%20%3CA%20href%3D%22https%3A%2F%2Fyoutu.be%2FaPYDMaeLncg%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fyoutu.be%2FaPYDMaeLncg%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-905056%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-905056%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F423575%22%20target%3D%22_blank%22%3E%40drewrogers%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20are%20several%20ways%20you%20can%20extract%20the%20unique%20items%20from%20a%20list.%3C%2FP%3E%3COL%3E%3CLI%3E%3CSTRONG%3EArray%20Formula%3C%2FSTRONG%3E%3C%2FLI%3E%3CLI%3E%3CSTRONG%3ERemove%20Duplicate%3C%2FSTRONG%3E%20feature%3A%20I%20this%20is%20one%20time%20requirement%2C%20you%20may%20copy%20your%20list%20of%20names%20to%20a%20blank%20column%2C%20go%20to%20Data%20Tab%20--%26gt%3B%20click%20on%20Remove%20Duplicates%20and%20this%20will%20remove%20all%20the%20duplicates%20leaving%20behind%20a%20list%20of%20all%20the%20unique%20names.%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EPivot%20Table%3A%3C%2FSTRONG%3E%20You%20can%20insert%20a%20Pivot%20Table%20and%20drag%20the%20Name%20Field%20from%20the%20Field%20List%20into%20the%20Rows%20area%20and%20you%20will%20see%20a%20unique%20list%20of%20names%20in%20the%20Pivot%20Table.%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EPower%20Query%3A%3C%2FSTRONG%3E%20You%20can%20create%20a%20query%20using%20Power%20Query%20and%20remove%20the%20duplicates%20in%20the%20query%20editor%20and%20load%20it%20back%20to%20the%20worksheet%2C%20a%20list%20of%20unique%20names.%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EVBA%3A%3C%2FSTRONG%3E%20Use%20VBA%20to%20generate%20a%20list%20of%20unique%20names.%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EDynamic%20Array%20Formula%20Unique%3A%3C%2FSTRONG%3E%20If%20you%20have%20access%20to%20the%20dynamic%20array%20formula%2C%20you%20can%20use%20UNIQUE%20function%20to%20get%20a%20unique%20list%20of%20names.%20Assuming%20your%20data%20is%20in%20A2%3AA25%2C%20place%20the%20formula%20%3CSTRONG%3E%3DUNIQUE(A2%3AA25)%3C%2FSTRONG%3E%20in%20a%20blank%20cell%20and%20hit%20Enter.%3C%2FLI%3E%3C%2FOL%3E%3CP%3EIn%20case%20of%20Array%20Formula%2C%20assuming%20your%20list%20is%20in%20A2%3AA25%2C%20place%20this%20Array%20Formula%20which%20requires%20confirmation%20with%20%3CSTRONG%3ECtrl%2BShift%2BEnter%3C%2FSTRONG%3E%20instead%20of%20Enter%20alone.%3C%2FP%3E%3CP%3EIn%20C2%3C%2FP%3E%3CP%3E%3DIFERROR(INDEX(%24A%242%3A%24A%2425%2CMATCH(0%2CINDEX(IF(%24A%242%3A%24A%2425%26lt%3B%26gt%3B%22%22%2CCOUNTIF(%24%3CSTRONG%3EC%3C%2FSTRONG%3E%241%3A%3CSTRONG%3EC%3C%2FSTRONG%3E1%2C%24A%242%3A%24A%2425))%2C0%2C0)%2C0))%2C%22%22)%3C%2FP%3E%3CP%3EConfirm%20with%20%3CSTRONG%3ECtrl%2BShift%2BEnter%3C%2FSTRONG%3E%20and%20copy%20it%20down%20until%20you%20get%20blank%20cells.%3C%2FP%3E%3CP%3EAdjust%20the%20range%20referred%20in%20the%20formula%20as%20per%20your%20requirement.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20may%20also%20create%20a%20%3CSTRONG%3EDynamic%20Named%20Range%3C%2FSTRONG%3E%20and%20refer%20it%20in%20the%20formula%20instead%20of%20referring%20ranges.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20plan%20to%20place%20the%20above%20formula%20in%20another%20column%2C%20don't%20forget%20to%20change%20the%20bold%20column%20letters%20in%20the%20above%20formula%20as%20per%20your%20formula%20column.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20find%20the%20attached%20with%20Array%20Formula%2C%20Dynamic%20Array%20Formula%20and%20Pivot%20Table%20solutions%20to%20get%20a%20unique%20list%20of%20names.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-905114%22%20slang%3D%22en-US%22%3ERE%3A%20Formulas%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-905114%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412741%22%20target%3D%22_blank%22%3E%40chrismenard7%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20you%20very%20much!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-905643%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-905643%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F423575%22%20target%3D%22_blank%22%3E%40drewrogers%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20non-array%20version%20of%20that%20which%20was%20suggested%20by%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394231%22%20target%3D%22_blank%22%3E%40Subodh_Tiwari_sktneer%3C%2FA%3E%20is%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3DIFNA(LOOKUP(2%2C1%2F(%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3ECOUNTIF(A%242%3AA%2425%2C%22%26gt%3B%3D%22%26amp%3BA%242%3AA%2425)%3DAGGREGATE(14%2C6%2C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3ECOUNTIF(A%242%3AA%2425%2C%22%26gt%3B%3D%22%26amp%3BA%242%3AA%2425)%2F(COUNTIF(C%241%3AC1%2CA%242%3AA%2425)%3D0)%2CROW()-1))%2C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EA%242%3AA%2425)%2C%22%22)%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
drewrogers
New Contributor

Hi all,

 

I have a list of names where some recur. I trying to find a formula that will create a list of all the names but without the duplicates. Does this exist?

 

Thanks so much

 

Drew

4 Replies
Hello James. If you have Office 365, Excel has a UNIQUE function. The UNIQUE function will extract a list of distinct values or unique values. Unique are values that occur only once. It sounds like you are looking for distinct, which it handles also. The UNIQUE function is a dynamic array function. Here is a video I created on how to use the function. https://youtu.be/P5QQPvDeFoo If you didn't want to use a function, you could also Copy and Paste and use Remove Duplicates which is on the Data Tab under the group Data Tools. One last thing you could use is a PivotTable and use the Distinct function. Here is a video I created on that feature. https://youtu.be/aPYDMaeLncg

@drewrogers 

There are several ways you can extract the unique items from a list.

  1. Array Formula
  2. Remove Duplicate feature: I this is one time requirement, you may copy your list of names to a blank column, go to Data Tab --> click on Remove Duplicates and this will remove all the duplicates leaving behind a list of all the unique names.
  3. Pivot Table: You can insert a Pivot Table and drag the Name Field from the Field List into the Rows area and you will see a unique list of names in the Pivot Table.
  4. Power Query: You can create a query using Power Query and remove the duplicates in the query editor and load it back to the worksheet, a list of unique names.
  5. VBA: Use VBA to generate a list of unique names.
  6. Dynamic Array Formula Unique: If you have access to the dynamic array formula, you can use UNIQUE function to get a unique list of names. Assuming your data is in A2:A25, place the formula =UNIQUE(A2:A25) in a blank cell and hit Enter.

In case of Array Formula, assuming your list is in A2:A25, place this Array Formula which requires confirmation with Ctrl+Shift+Enter instead of Enter alone.

In C2

=IFERROR(INDEX($A$2:$A$25,MATCH(0,INDEX(IF($A$2:$A$25<>"",COUNTIF($C$1:C1,$A$2:$A$25)),0,0),0)),"")

Confirm with Ctrl+Shift+Enter and copy it down until you get blank cells.

Adjust the range referred in the formula as per your requirement.

 

You may also create a Dynamic Named Range and refer it in the formula instead of referring ranges.

 

If you plan to place the above formula in another column, don't forget to change the bold column letters in the above formula as per your formula column.

 

Please find the attached with Array Formula, Dynamic Array Formula and Pivot Table solutions to get a unique list of names.

 

 

@chrismenard7 

 

Thanks you very much!

@drewrogers 

My non-array version of that which was suggested by @Subodh_Tiwari_sktneer is: 

=IFNA(LOOKUP(2,1/(
COUNTIF(A$2:A$25,">="&A$2:A$25)=AGGREGATE(14,6,
COUNTIF(A$2:A$25,">="&A$2:A$25)/(COUNTIF(C$1:C1,A$2:A$25)=0),ROW()-1)),
A$2:A$25),"")

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies