Question:
Is there a way to remove duplicate columns in excel?
AVANTI
2010-02-12 20:03:50 UTC
Actually there is a way to remove duplicate rows I cant find any way to remove duplicate column.If there is no such inbuilt function in excel ,Kindly help me in creating this functionality with the help of macros.
Ten answers:
IXL@XL
2010-02-13 00:15:46 UTC
Most unlikely to have duplicate columns as each column can have so much data associated with them. If however you wish to dompare data within one row for duplications use this in B2

=COUNTIF($A1:A1,B1) where row 1 is the one being examined for duplicates. Copy across row 2 to last column used. Sorts will be virtually impossible but any column with a value of 1 or more indicates a duplicate of an earlier column. You could use conditional formatting to highlight the cells with more than zero appearances.
2016-12-26 13:14:32 UTC
Remove Duplicates In Excel Column
ewert
2016-11-16 19:54:30 UTC
Excel Remove Duplicates From Column
Shanae
2015-08-10 08:40:29 UTC
This Site Might Help You.



RE:

Is there a way to remove duplicate columns in excel?

Actually there is a way to remove duplicate rows I cant find any way to remove duplicate column.If there is no such inbuilt function in excel ,Kindly help me in creating this functionality with the help of macros.
devilishblueyes
2010-02-15 10:44:54 UTC
Aye Caramba! Everyone else is making this so complicated!!! It's actually very simple. If you are using Excel 2007, select your data and copy it. Pick a blank spreadsheet, then right click cell A1 and select Paste Special. Down at the bottom right of the paste special window you will see a checkbox that says Transpose. Make sure Transpose is checked and then click OK. What this does is it rotates all of your data 90 degrees. So the data that was once in columns is now in rows and the data that was in rows is now in columns. Now go to the Data tab, select your newly pasted data, then click Remove Duplicates. This removes your duplicates. Now just take the data, copy it, and transpose it again so that your columns are once more back as columns and your rows are once more back as rows like they were originally but with the duplicates now removed.



Basically you use the Remove Duplicates like you do for rows. You just transpose the data twice. You get the data to rows, remove the duplicates then get the data back to columns. No biggie!!!



Everybody is making this one WAY too hard!



It can be done in Excel 2003 too.
Maureen
2016-04-06 06:23:43 UTC
For the best answers, search on this site https://shorturl.im/axBCZ



Insert a helper column between columns B and C and enter this formula in the new column C and copy down the length of the data. =IF(COUNTIF(A:A,B1)>0,"dup","") This will identify all values in column B that appear in column A. Delete the entries that have "dup" beside them. Now delete the helper column. Insert a helper column between columns C and D and enter the same formula changing the A:A reference to B:B and the B1 to C1 and copy down the length of the data. Again delete all entries marked with "dup" beside them. Repeat for the last column.
2010-02-12 20:15:36 UTC
If you mean you want to remove rows that have duplicate data in a column, you'll wonder why you didn't think of it yourself (my wife, who teaches Excel, taught it to me):



In an unused column, put the formula (assuming your two columns are A and B) =IF(A2=A1, "!", "0") into row 2 of that column. Pull it down (lower-right corner of that cell) as far down as your data goes. Copy the new column. Paste Special/Values it back to the same column. You'll have 1s and 0s in the column. Highlight the whole sheet (upper left corner). Data/Sort. Sort on that new column, descending. All the duplicates are on top - the cells in the new column with the 1s. Delete those rows.



It's faster to do than to type the instructions.
Iggi
2010-02-12 23:57:19 UTC
u idiot colanath she is asking for coluns u r telling for rows.and wife teaches u this kind of excel i dunno what she teaches students.

here is the answer

Option Explicit



Sub DeleteDups()



Dim x As Long

Dim LastRow As Long



LastRow = Range("A65536").End(xlUp).Row

For x = LastRow To 1 Step -1

If Application.WorksheetFunction.CountIf(Range("A1:A" & x), Range("A" & x).Text) > 1 Then

Range("A" & x).EntireRow.Delete

End If

Next x



End Sub





How to use:



Open Excel 2003/07.

Alt + F11 to open the Visual Basic Editor (VBE).

Insert-Module.

Paste the code.

Close the VBE (Alt + Q or the X in the top-right corner).





Test the code:



In Column A add any data.

Tools-Macro-Macros

Select DeleteDups and press Run
Ruding E
2010-02-12 20:21:57 UTC
right click the the very top cell(has a letter(s) on it) of the column to highlight the entire column you want to delete. right click it to access the shortcut drop down menu. click delete.
2010-02-13 00:25:31 UTC
Ignatius is right,colnath u idiot rascal tell u wife to learn from me excel



In Microsoft Office Excel 2007, you have several ways to filter for unique values or remove duplicate values:



To filter for unique values, use the Advanced command in the Sort & Filter group on the Data tab.

To remove duplicate values, use the Remove Duplicates command in the Data Tools group on the Data tab.

To highlight unique or duplicate values, use the Conditional Formatting command in the Style group on the Home tab.



What do you want to do?



--------------------------------------------------------------------------------

Learn about filtering for unique values or removing duplicate values

Filter for unique values

Remove duplicate values

Conditionally format unique or duplicate values



--------------------------------------------------------------------------------



Learn about filtering for unique values or removing duplicate values

Filtering for unique values and removing duplicate values are two closely related tasks because the displayed results are the same — a list of unique values. The difference, however, is important: When you filter for unique values, you temporarily hide duplicate values, but when you remove duplicate values, you permanently delete duplicate values.



A duplicate value is one where all values in the row are an exact match of all the values in another row. Duplicate values are determined by the value displayed in the cell and not necessarily the value stored in the cell. For example, if you have the same date value in different cells, one formatted as "3/8/2006" and the other as "Mar 8, 2006", the values are unique.



It's a good idea to filter for or conditionally format unique values first to confirm that the results are what you want before removing duplicate values.



Top of Page



Filter for unique values

Select the range of cells, or make sure the active cell is in a table.

On the Data tab, in the Sort & Filter group, click Advanced.





In the Advanced Filter dialog box, do one of the following:

To filter the range of cells or table in place, click Filter the list, in-place.

To copy the results of the filter to another location, do the following:

Click Copy to another location.

In the Copy to box, enter a cell reference.

Alternatively, click Collapse Dialog to temporarily hide the dialog box, select a cell on the worksheet, and then press Expand Dialog .

Select the Unique records only check box, and click OK.

The unique values from the selected range are copied to the new location.

Top of Page



Remove duplicate values

When you remove duplicate values, only the values in the range of cells or table are affected. Any other values outside the range of cells or table are not altered or moved.



Caution Because you are permanently deleting data, it's a good idea to copy the original range of cells or table to another worksheet or workbook before removing duplicate values.



Select the range of cells, or make sure that the active cell is in a table.

On the Data tab, in the Data Tools group, click Remove Duplicates.





Do one or more of the following:

Under Columns, select one or more columns.

To quickly select all columns, click Select All.

To quickly clear all columns, click Unselect All.

If the range of cells or table contains many columns and you want to only select a few columns, you may find it easier to click Unselect All, and then under Columns, select those columns.

Click OK.

A message is displayed indicating how many duplicate values were removed and how many unique values remain, or if no duplicate values were removed.



Click OK.

Issue: I'm having problems removing duplicate values from data that is outlined or that has subtotals.



You cannot remove duplicate values from data that is outlined or that has subtotals. To remove duplicates, you must remove both the outline and the subtotals. For more information, see Outline a list of data in a worksheet and Remove subtotals.

Top of Page



Conditionally format unique or duplicate values

Note You cannot conditionally format fields in the Values area of a PivotTable report by unique or duplicate values.



Quick formatting



Select one or more cells in a range, table, or PivotTable report.

On the Home tab, in the Style group, click the arrow next to Conditional Formatting, and then click Highlight Cells Rules.





Select Duplicate Values.

Enter the values that you want to use, and then select a format.

Advanced formatting



Select one or more cells in a range, table, or PivotTable report.

On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then click Manage Rules.

The Conditional Formatting Rules Manager dialog box is displayed.



Do one of the following:

To add a conditional format, click New Rule.

The New Formatting Rule dialog box is displayed.



To change a conditional format, do the following:

Make sure that the appropriate worksheet or table is selected in the Show formatting rules for list


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...