How to extract and list unique values from a range excluding blanks and zeros

Mark McInerney

Active Member
Joined
Apr 4, 2012
Messages
283
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have a range of data a1:a10000.

In this range there are duplicate values, unique values, blanks and zeros. I am looking for a formula that I can copy fill from B1 that will list only unique values, whilst excluding zeros and blanks.

A1 = Book
A2 = Book
A3 =
A4 = 0
A5 = Toy
A6 = Farm
A7 = 0
A8 = Book
A9 = Toy

I want the data that extends from cell B1 to be

B1 = Book
B2 = Toy
B3 = Farm

Is there a formula that I can copy fill to give this result.

Any Help greatly appreciated.

Thanks - Mark.
 
Hi Eric,

I can't thank you enough - this is excellent. You are exceptional - very grateful.

Best - Mark.
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi Eric,

Back again - so sorry. It is working fine, but when I copy fill the formula down, it is pulling in duplicates - I'd love to tell you I know how to remove them....I am out of my depth. Any advice would be appreciated.

Thanks again - Mark.
 
Upvote 0
Change the D2 formula to:

=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW(B$1:B$10000)/(A$1:A$10000=$D$1)/(COUNTIF($D$1:$D1,$B$1:$B$10000)=0),1)),"")
 
Upvote 0
Some alternative formulas. I have assumed a heading row exists, or can be made to exist. If that is not possible then further alternatives are available.
data Validation is again in D1

Excel Workbook
ABCD
1List 1List 2Unique 1Book
2BookFictionBookFiction
3BookHorrorToyHorror
4FarmAutobiography
50
6ToyGame
7FarmCow
80
9BookAutobiography
10ToyActionman
11BookHorror
12
Lists
 
Upvote 0
Hi Peter,

Another genius - am jealous as to how you guys come up with these things! I tried it this morning and it too works perfectly. Thank you very much for taking the time to review and respond to my query.

Thanks and appreciation - Best - Mark.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top