简体   繁体   中英

Delete EXCEL consecutive rows that have same values from 2 columns but different from 1 column

I have the data about all calls between people from my company and people from outside the company but I'm unable to treat the data properly. There are 9 columns but only 3 are relevant:

Date (which in fact its date and time: "2017-10-30 10:52:19");

Source (phone number);

Status (answered, not answered, busy, failed);

And 39264 rows....

So here is the problem: most of the times, I have the same "date" from the same "source" number to different destinations of the company that were "NOT ANSWERED" (in consecutive rows), but some rows after the exactly same "date" and "source" are "ANSWERED" by another destination number inside the company. So, it seems that were like 10 "NOT ANSWERED" calls, but in fact the call was "ANSWERED" by somebody.

What I need is to delete the fake "NOT ANSWERED" calls so they will not be part of my data analysis. I installed Kutools but it does not seem that it can help me.

Can someone pleaase help me doing this with VBA? Or somehow?!

Assuming the rows are sorted by call Date Time, Source, the Status you want to keep always comes last, and A is Call Date/Time, B is Source #, C is Status and data starts on row 2, put in an empty column on row 2:

=AND(C2="NOT ANSWERED",A2=A3,B2=B3)

Then copy this down the column. All the TRUE cells should be the redundant NOT ANSWERED rows, so use a filter to hide the others, select them and delete them. Or sort by the new column, then delete the TRUE.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM