A very particular way to select data

gregmartjim

New Member
Joined
Jun 14, 2018
Messages
9
Hello Mr Excel and everyone

I have a problem , i am trying to select some data from a set but in a very particular way.
the data i have is something like the data below, what id like to do is to delete the whole row if the number in the second column is repeated, but i want to keep the last repeated value and delete the other values above.

For example the first and second row have the same value in column 2 (the value is 1) i want to delete all the first row and just leave the second one. An other example, the rows 9 to 11 have the same value in column 2 (the value is 1 again) here i would like to delete row 9 & 10. Final example, the rows 3 and 4 have the same value (2) i would like to delete all row number 3 and keep row 4. I will really appreciate if someone could help me with this problem. Thanks for reading

110.6441.931274.895
110.6641.121274.8375
120.9740.681290.7075
120.9341.881290.7075
131.1144.381311.235
130.8341.921311.12
141.1842.831331.245
141.5843.261331.4175
110.5754.071270.98
110.5755.141270.98
110.6856.191270.98
120.5253.81290.96
120.5653.361290.78
130.7658.581310.94
130.6456.71310.76
140.7549.141331.1
140.846.671331.1
110.4852.051271.34
110.5251.571271.34
110.5250.411271.34
120.750.841291.14
120.651.761291.14
130.6954.791311.12
130.855.451311.12
140.8351.361331.1
141.0552.731331.1
110.4739.461271.0425
110.4139.521270.985
120.5853.11290.995
120.652.651290.995
131.0552.441311.12
130.9853.371311.12
141.0748.861331.015
141.147.461331.015
110.4256.861270.98
110.4454.531270.98
120.4250.121290.96
120.4351.051290.96
130.5858.821310.76
130.5457.631310.76
140.7948.761331.1
140.7948.211331.1

<colgroup><col span="4"><col></colgroup><tbody>
</tbody>
 
Tom
The rows i will keep are not the "-" (these are the first of every set of repetition) i want to keep the last of every set of repetitions, so far your formula gives me the first one, not the last one. An example is the row 4 and row 9 are rows i would like to delete.
 
Last edited:
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
My first formula did what you now say. We've come full circle on this because this last iteration kept the last and deleted the previous repeated items. Maybe something else is going on with your workbook that you are either not saying or not aware of. Otherwise, I cannot assist further without a more complete representation of your data and what you expect.
 
Upvote 0
Hello, am I reading this wrong, or do you want a formula like this to filter for the "X" (in column "H" for row 2)

=IF(D2=D3,"","X")
 
Upvote 0
Tom
Sorry about this could you please put the old and the new formula to see the difference, old one selecting the last data, and new selecting the first.

Joyner

I want a formula to select the last row of the repeated number, tom help me selecting this with an "x" or a "-" of each , after this selection i already now how to filter the data
 
Upvote 0
Ok, I think my formula is putting an "X" for rows to keeps and Tom's was putting an "X" for rows to delete (I guess I usually use ones and zeros). If that is what you want try my formula like this:

=IF(D2=D3,"X","")


If I am applying Tom's formula correctly, it looks like it is missing some where there are multiple instances and there is only one of the next number - I'm not sure if you would have that case.
 
Last edited:
Upvote 0
Joyner

Your formula separates the first with a "-" from all the set of repeated values but i want to keep the last one , not the first.


NNK6-0001110.94-0.941270.8-
NNK6-0001110.96-0.961270.8x
NNK6-0001110.93-0.931270.8x
NNK6-00011410.9239.931336.5-
NNK6-00011410.9339.971336.5x
NNK6-0272110.6441.931274.895-
NNK6-0272115.63-0.481273.2275x
NNK6-0272110.6641.121274.8375x
NNK6-027211210-165.341272.48x
NNK6-0272120.9740.681290.7075-
NNK6-0272120.9341.881290.7075x
NNK6-0272131.1144.381311.235-
NNK6-0272130.8341.921311.12x
NNK6-0272141.1842.831331.245-
NNK6-0272141.5843.261331.4175x

<colgroup><col span="6"><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
Success

Thanks guys you help me a lot to solve it , actually what i was looking for was the opposite of what you were giving me, the right formula should be in this configuration

=IF(D2<>D3,"X","")



 
Upvote 0

Forum statistics

Threads
1,215,152
Messages
6,123,323
Members
449,094
Latest member
Chestertim

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