Delete Rows if certain conditions exist

TXG8T3R

New Member
Joined
Mar 20, 2018
Messages
1
I have a spreadsheet that I am trying to clean up.

If an Order number has as it's Status both a PUR and a RCV, I want to delete both rows,
leaving only Order Numbers with the Status of PUR.

How would I go about doing that?

Example below:


Order Number
Status
000000177
PUR
000000230
RCV
000000230
PUR
000000240
RCV
000000240
PUR
000000252
PUR
000000300
PUR

<tbody>
</tbody>


<tbody>
</tbody>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
(Forget what I wrote before). You can write a countif formula to return an error or number that F5(Goto)-special can pick up, then delete the rows:


Excel 2010
ABC
1Order NumberStatus
2177PUR1
3230RCV#DIV/0!
4230PUR#DIV/0!
5240RCV#DIV/0!
6240PUR#DIV/0!
7252PUR1
8300PUR1
Sheet3
Cell Formulas
RangeFormula
C2=IF(COUNTIF($A$2:$A$8,A2)=2,1/0,1)


Assuming the order number never appears more than twice, otherwise an extra condition can be added.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

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