Delete Row Based on Row Position

syedbokhari

Board Regular
Joined
Aug 19, 2013
Messages
94
Hi Guys,

I have the row number of some values in a sheet (column E) see picture.

HH14X9C.png


I need to delete the row where the corresponding value sits.

I have used match to give me this as you can see from the picture.

The issue is that the value sometimes can be present in the look up column (column A).

Upon deleting the ROW the match will provide an NA which is perfectly fine as this will indicate there is only one unique value in column A.

Currently the value in column E can also be in A ...

That will indicate that this is the only value present and the corresponding value isn't present anymore.

The final result should look like this.

HH18Kte.png


The data set is much larger then this so I have just shortened it to make it easier (+6000 Rows).

I tried writing this in VBA but my skills aren't up to scratch as I'm still a beginner.

If you guys could help that would be awesome and I would be most grateful. Unfortunately I can't send food across the internet otherwise I would of provide you guys with some lemon cake.

Thanks,

Sy
 
Name your columns like this:

PERSON ID / RELATIVE ID / MATCH / DELETE


Fill data for PERSON ID & RELATIVE ID like you already have.

MATCH COLUMN: =IF(IFERROR(MATCH([@[RELATIVE ID]],[PERSON ID],0),0)>0,MAX([@[PERSON ID]],[@[RELATIVE ID]]),"")
DELETE COLUMN: =IF([@MATCH]=[@[PERSON ID]],"DELETE","")


On any of the formula cells, you can click into the cell entry thing at the top, excel will highlight which cells and columns are getting used so you have an idea of whats happening.

You can rename the columns any way you like after, Excel will update the formulas accordingly.
 
Last edited:
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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