# Microsoft Office Application Help - Excel Help forum > Excel Charting & Pivots >  >  Selection of 2 rows of data of sales and return and delete them

## a_raja

Hello All.

I am a general user of Excel with just the basic concept of using it. Now my job demands to remove data (sales and reurns) which are there and only to keep unique fields(sales or returns) i tried using countif but its not of much help as there are different values that needed to be checked.

attaching the sample data for your reference.

All i want is to have unique data and remove sales returns which are same, that too automatically 

Thanking you in advance.

Ashit

----------


## AliGW

Welcome to the forum.  :Smilie: 

Is it definitely Excel 2019 that you have,and not MS365? If it's the latter, this may be easier, so can you please confirm?

Also, please mock up MANUALLY what you want to see - we need a BEFORE and AFTER in the sample workbook, please.

----------


## a_raja

Thanks for taking interest in my query

My excel version is Microsoft® Excel® 2016 MSO (16.0.14228.20200) 64-bit 

I have uploaded a new file where before and after are shown in different sheets

Thanks Again

----------


## JeteMc

If it is acceptable to put the distinct sales records on a separate sheet then the following may help.
1. Populate column G on the Before sheet using: =IF(OR(C2="Cancel",COUNTIFS(E$2:E$27,E2)>1),0,1)
2. Populate the range on the After sheet using: =INDEX(Before!A$2:A$27,AGGREGATE(15,6,(ROW(Before!A$2:A$27)-ROW(Before!A$1))/(Before!$G$2:$G$27=1),ROWS(A$1:A1)))
Let us know if you have any questions.

----------

