Formula to Remove Duplicates from List... IF

tobermory

New Member
Joined
Jun 4, 2012
Messages
46
Hello there,

I know you can remove duplicates with the 'Remove Duplicates' tab, however is there a way to do it formula wise, including an if statement?

For instance, in the dataset below, I need the unique values for each fruit. So, for instance, the unique values for Oranges would be 1, 2 and 3.

Apples - 1, 2, 3, 4, 5
Pears - 1, 2

Col ACol B
Oranges2
Pears1
Pears1
Oranges1
Oranges1
Apples2
Apples4
Apples1
Pears1
Pears2
Oranges1
Oranges2
Apples4
Apples5
Apples3
Oranges3
Pears1
Pears1

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>

Is there a way to achieve this?

Many Thanks
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hello, can you use a Pivot Table?

Just add both Column fields to the Rows Area and you have it.
 
Upvote 0
Hello, can you use a Pivot Table?

Just add both Column fields to the Rows Area and you have it.

Thanks for your reply.

Yes I'm aware of PivotTables and how to do this, however for purpose of what I'm trying to achieve a formula'ed version would be more beneficial as I would be using the formula fairly regularly and would like it to update automatically rather than having to refresh the PivotTable all the time.
 
Upvote 0
Ok, then I think you need a bit more information
For your output you show:
Apples - 1, 2, 3, 4, 5
Pears - 1, 2
Do you expect to have this is one cell, just like you show,or is each item in a separate cell across a row or can it be in two columns etc.?
What version of Office / Excel do you have?
If 2016, which version?
I believe you will be looking at a fairly complex array formula. If I had a lot of data I would go with the Pivot Table / Power Query solution and use a macro to automatically update itif that was important.
For the array formula, Excelisfun has a lot of videos that show some complicated formulas to extract unique lists, like here for several examples:
https://www.youtube.com/watch?v=J6yeTUFkLzQ
 
Last edited:
Upvote 0
Since your column B values are numeric, you could try this. Formula in E2 is copied across and down.

Excel Workbook
ABCDEFG
1Col ACol BOrangesApplesPears
2Oranges2111
3Pears1222
4Pears133
5Oranges14
6Oranges15
7Apples2
8Apples4
9Apples1
10Pears1
11Pears2
12Oranges1
13Oranges2
14Apples4
15Apples5
16Apples3
17Oranges3
18Pears1
19Pears1
Unique Values
 
Upvote 0

Forum statistics

Threads
1,214,825
Messages
6,121,788
Members
449,049
Latest member
greyangel23

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