Excel delete duplicates based on previous row

floggingmolly

Board Regular
Joined
Sep 14, 2019
Messages
167
Office Version
  1. 365
Platform
  1. Windows
I'm not sure this is even possible, but I will try to explain the best I can.
I have a data set that lists Sent and Opened messages. The rows are sorted so they appear like below:

Message 1 Sent 7/11/2022
Message 1 Opened 7/11/2022
Message 2 Sent 7/12/2022
Message 2 Opened 7/12/2022
Message 2 Opened 7/13/2022
Message 3 Sent 7/14/2022
Message 3 Sent 7/14/2022

So, for example message 1 was sent and opened. Message 2 was sent and shows opened 2 times. Message 3 was sent but not opened. Also the messages can be sent to more than 1 recipient which is why message 3 shows sent 2 times.
If a message was opened 2 times, like message 2, I want to get rid of the duplicate row. I can't do remove duplicates because then message 3 would get removed because it was sent 2 times.
Is there a way to remove a row if the row above it contains the same criteria? Like if Row 5 shows opened, and row 4 shows opened, then delete row 5?

I hope this makes sense. I'm not even sure anything like this is possible, but thought I would ask.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Based on this logic
Is there a way to remove a row if the row above it contains the same criteria? Like if Row 5 shows opened, and row 4 shows opened, then delete row 5?
The second Messsage 3 would have to go as well as it is a duplicate of the line above it.

Is it only the "opened" duplicates you want to get rid of and is this all the data you have to do comaprison on. Any chance of using the XL2BB addin to give us some data to work with.
 
Upvote 0
I tried installing the add in but it keeps giving me a message that macros were disabled and won't let me use it
 
Upvote 0
My solution is to add a column to label the "duplicates", which are the rows to be deleted. The formula distinguishes if Columns A and B equal the previous row, as well as if Column B is "Opened".
1671147725028.png
 
Upvote 0
Then Filter all the "Yes" in column D and you can delete them all at once
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,573
Members
449,089
Latest member
Motoracer88

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