detection of rows of the duplicated names in a table

masoud12

New Member
Joined
Jul 30, 2023
Messages
12
Office Version
  1. 2013
i have table. some names of the first row are duplicated. i sort the names now i want to detect the first and last row number for the duplicated names.
sample1.xlsx
ABCD
1countforst rowlast row
2peter123
3peter123
4john244
5ali355
6mori468
7mori468
8mori468
9anderson599
10caroline61010
11pele71112
12pele71112
Sheet1
 

Attachments

  • pic2.JPG
    pic2.JPG
    26.7 KB · Views: 6

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
so i have the first column and i want the last three column. or even only last column.
 
Upvote 0
Try the following:
Excel Formula:
MAX(IF(A$2:A$12=A2,ROW(A$2:A$12),0))
 
Upvote 0
I'm not sure if this is any better but give it a go?
Excel Formula:
=LOOKUP(2,1/($A$2:$A$12=A2),ROW($A$2:$A$12))
 
Upvote 0
Try these. Should not be much overhead.

23 07 31.xlsm
ACD
1firstlast
2peter23
3peter23
4john44
5ali55
6mori68
7mori68
8mori68
9anderson99
10carolins1010
11pele1112
12pele1112
First Last Rows
Cell Formulas
RangeFormula
C2:C12C2=IF(A2=A1,C1,ROW())
D2:D12D2=IF(A2=A3,D3,ROW())
 
Upvote 0

Forum statistics

Threads
1,215,212
Messages
6,123,651
Members
449,111
Latest member
ghennedy

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