{"items":["5fda1ff2ffb0f20017abdb74","5fda1ff2ffb0f20017abdb70","5fda1ff2ffb0f20017abdb71"],"styles":{"galleryType":"Columns","groupSize":1,"showArrows":true,"cubeImages":true,"cubeType":"max","cubeRatio":1.7777777777777777,"isVertical":true,"gallerySize":30,"collageAmount":0,"collageDensity":0,"groupTypes":"1","oneRow":false,"imageMargin":5,"galleryMargin":0,"scatter":0,"rotatingScatter":"","chooseBestGroup":true,"smartCrop":false,"hasThumbnails":false,"enableScroll":true,"isGrid":true,"isSlider":false,"isColumns":false,"isSlideshow":false,"cropOnlyFill":false,"fixedColumns":0,"enableInfiniteScroll":true,"isRTL":false,"minItemSize":50,"rotatingGroupTypes":"","rotatingCropRatios":"","columnWidths":"","gallerySliderImageRatio":1.7777777777777777,"numberOfImagesPerRow":3,"numberOfImagesPerCol":1,"groupsPerStrip":0,"borderRadius":0,"boxShadow":0,"gridStyle":0,"mobilePanorama":false,"placeGroupsLtr":false,"viewMode":"preview","thumbnailSpacings":4,"galleryThumbnailsAlignment":"bottom","isMasonry":false,"isAutoSlideshow":false,"slideshowLoop":false,"autoSlideshowInterval":4,"bottomInfoHeight":0,"titlePlacement":["SHOW_ON_THE_LEFT","SHOW_BELOW"],"galleryTextAlign":"center","scrollSnap":false,"itemClick":"nothing","fullscreen":true,"videoPlay":"hover","scrollAnimation":"NO_EFFECT","slideAnimation":"SCROLL","scrollDirection":0,"scrollDuration":400,"overlayAnimation":"FADE_IN","arrowsPosition":0,"arrowsSize":23,"watermarkOpacity":40,"watermarkSize":40,"useWatermark":true,"watermarkDock":{"top":"auto","left":"auto","right":0,"bottom":0,"transform":"translate3d(0,0,0)"},"loadMoreAmount":"all","defaultShowInfoExpand":1,"allowLinkExpand":true,"expandInfoPosition":0,"allowFullscreenExpand":true,"fullscreenLoop":false,"galleryAlignExpand":"left","addToCartBorderWidth":1,"addToCartButtonText":"","slideshowInfoSize":200,"playButtonForAutoSlideShow":false,"allowSlideshowCounter":false,"hoveringBehaviour":"NEVER_SHOW","thumbnailSize":120,"magicLayoutSeed":1,"imageHoverAnimation":"NO_EFFECT","imagePlacementAnimation":"NO_EFFECT","calculateTextBoxWidthMode":"PERCENT","textBoxHeight":26,"textBoxWidth":200,"textBoxWidthPercent":65,"textImageSpace":10,"textBoxBorderRadius":0,"textBoxBorderWidth":0,"loadMoreButtonText":"","loadMoreButtonBorderWidth":1,"loadMoreButtonBorderRadius":0,"imageInfoType":"ATTACHED_BACKGROUND","itemBorderWidth":0,"itemBorderRadius":0,"itemEnableShadow":false,"itemShadowBlur":20,"itemShadowDirection":135,"itemShadowSize":10,"imageLoadingMode":"BLUR","expandAnimation":"NO_EFFECT","imageQuality":90,"usmToggle":false,"usm_a":0,"usm_r":0,"usm_t":0,"videoSound":false,"videoSpeed":"1","videoLoop":true,"jsonStyleParams":"","gallerySizeType":"px","gallerySizePx":292,"allowTitle":true,"allowContextMenu":true,"textsHorizontalPadding":-30,"itemBorderColor":{"themeName":"color_12","value":"rgba(220,226,233,0)"},"showVideoPlayButton":true,"galleryLayout":2,"calculateTextBoxHeightMode":"MANUAL","targetItemSize":292,"selectedLayout":"2|bottom|1|max|true|0|true","layoutsVersion":2,"selectedLayoutV2":2,"isSlideshowFont":true,"externalInfoHeight":26,"externalInfoWidth":0.65},"container":{"width":300,"galleryWidth":305,"galleryHeight":0,"scrollBase":0,"height":null}}

# How to Extract a Unique List in Excel: Array Formula

I am often asked how you can extract a unique list of values from a data set containing duplicate values. A quick and easy way to extract a list of unique values from duplicate items is by creating a Pivot Table. The problem with this is that whenever you have new data you have to keep on refreshing the Pivot Table. What about if you want the list to be dynamic, i.e. the unique list will update automatically whenever there is new data? Well the best way to do this is by creating an array formula.

I will teach you how to create the array formula and then break the formula down so you know how it is calculated.

**Array Formula to Extract Unique Values**

In column A there is a list of names. As you can see the names have been repeated. I want to create a unique list in column B so there are no duplicate entries.

The formula in cell B2 is **={INDEX($A$2:$A$20, MATCH(0, COUNTIF($B$1:B1, $A$2:$A$20), 0))}**. This is an array formula so you must press Control + Shift + Enter after you have typed in the formula. Once I have created the formula in cell B2 I just copied it down to cell B20. You can see that the formula has created a unique list of names. Duplicate names are not included.

You will notice the #N/A errors. This occurs when all the unique names have been extracted and there are no more names left to extract.

To eliminate these #N/A errors you can wrap the array formula in an IFERROR function.

**How does the Array Formula Work?**

The array formula contains the COUNTIF, MATCH, INDEX and IFERROR functions. I will use the formula in cell B2 to explain how it works:

**1) The COUNTIF Function**

**COUNTIF($B$1:B1, $A$2:$A$20)**

The COUNTIF function counts the number of cells that meet a criteria in a given range.

The COUNTIF function in cell B2 will return:

COUNTIF("Unique distinct list",{Peter Jennings, Huw Smith, Emma Palmer, Jon Parker, Eddie Jenkins, Sarah Cane, Amit Kumar, Huw Smith, Sarah Cane, Peter Jennings, Eddie Jenkins, Emma Palmer, Sarah Cane, Huw Smith, Peter Jennings, Emma Palmer, Amit Kumar, Sarah Cane, Eddie Jenkins})

This will return an array which will contain 1 or 0 based on if the range B$1:B1 is found in the list in $A$2:$A$20.

The COUNTIF function will return the result array {0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0} as $B$1:B1 (“Unique List”) is not found in the range $A$2:$A$20

**2) The MATCH Function**

**MATCH(0, COUNTIF($B$1:B4, $A$2:$A$20), 0)**

The MATCH function returns the position of the lookup value in an array.

The MATCH function in cell B2 will return the array:

MATCH(0,{0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0},0)

The lookup value is 0 and the first value in the result array is 0 so the function returns 1.

**3) The INDEX Function**

I**NDEX($A$2:$A$20, MATCH(0, COUNTIF($B$1:B4, $A$2:$A$20), 0))**

The INDEX function returns the cell value based on the row number specified. The MATCH function returns the row number 1 as explained above so the INDEX function uses the first value in the range $A$2:$A$20 and returns "Peter Jennings".

**4) The IFERROR Function**

**IFERROR(INDEX($A$2:$A$20, MATCH(0, COUNTIF($B$1:B1, $A$2:$A$20), 0)),"")**

The IFERROR function removes all the #N/A errors and returns an empty string instead.

**Relative and Absolute Cell References**

Notice the relative cell referencing on $B$1:B1 and absolute referencing on the range $A$2:$A$20. This is because we want to include the names in the formula in column B to check how many there are in column A as we copy it down. In order for the formulas to work correctly we also have to make sure the range A2:A20 remains constant as we copy the formula down.

**Conclusion**

I hope you enjoyed this tutorial on how to extract a unique list in Excel from a list of duplicate values. Please leave a comment below if you would like a further explanation or help with the array formula or if you know of any other ways to extract a unique list.

#arrayformula #removeduplicatesinexcel #HowtoextractauniquelistinExcel