Duplicate entries

MEZHH

New Member
Joined
Jan 27, 2025
Messages
5
Office Version
  1. 2024
Platform
  1. Windows
Hi. I have an Excel file, which there is data about 2000+ people. It's the date they entry and exit from office building. Some people use their card multiple times and there are their names in excel in multiple places. I need to find their actual entry (it's the first time the name shown) and exit date (it's the last time), not during the day.


example.xlsx
C
5John Smith 27.01.2025 9:00
6Shanice Raymond 27.01.2025 9:05
7Naima Holmes 27.01.2025 9:35
8Inaaya Richard 27.01.2025 9:12
9Shanice Raymond 27.01.2025 10:15
10Luna Snyder 27.01.2025 9:06
11Isobel Myers 27.01.2025 9:18
12Shanice Raymond 27.01.2025 11:20
Sheet1
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
not during the day
What do you mean by this? Explain in detail using an example from your data. In which row do your names start? Where do you want to put your desired results?
 
Upvote 0
Assuming Office 365...
In cell C1, enter this formula:
Excel Formula:
=LET(data,A1:A8,UNIQUE(TRIM(SUBSTITUTE(data,TEXTAFTER(TEXTAFTER(data," ")," "),""))))
In cell D1:
Excel Formula:
=LET(data,A1:A8,names,TRIM(SUBSTITUTE(data,TEXTAFTER(TEXTAFTER(data," ")," "),"")),firstOnes,XLOOKUP(C1#,names,data),TEXTAFTER(TEXTAFTER(firstOnes," ")," "))*1
In cell E1:
Excel Formula:
=LET(data,A1:A8,names,TRIM(SUBSTITUTE(data,TEXTAFTER(TEXTAFTER(data," ")," "),"")),firstOnes,XLOOKUP(C1#,names,data,,0,-1),TEXTAFTER(TEXTAFTER(firstOnes," ")," "))*1
Adjust A1:A8 accordingly
 
Upvote 0
Solution
What do you mean by this? Explain in detail using an example from your data. In which row do your names start? Where do you want to put your desired results?
All employees has a card, which is using when they enter to the building and exit from building and the card reading system converts this data to an excel file. If an employee enters to the building 3 times and exits 3 times, it means his name will be on excel file 6 times. I need only first time he enters the building and the last time he exits from building.
 
Upvote 0
Assuming Office 365...
In cell C1, enter this formula:
Excel Formula:
=LET(data,A1:A8,UNIQUE(TRIM(SUBSTITUTE(data,TEXTAFTER(TEXTAFTER(data," ")," "),""))))
In cell D1:
Excel Formula:
=LET(data,A1:A8,names,TRIM(SUBSTITUTE(data,TEXTAFTER(TEXTAFTER(data," ")," "),"")),firstOnes,XLOOKUP(C1#,names,data),TEXTAFTER(TEXTAFTER(firstOnes," ")," "))*1
In cell E1:
Excel Formula:
=LET(data,A1:A8,names,TRIM(SUBSTITUTE(data,TEXTAFTER(TEXTAFTER(data," ")," "),"")),firstOnes,XLOOKUP(C1#,names,data,,0,-1),TEXTAFTER(TEXTAFTER(firstOnes," ")," "))*1
Adjust A1:A8 accordingly
I'll try it. Thanks
 
Upvote 0
Assuming Office 365...
In cell C1, enter this formula:
Excel Formula:
=LET(data,A1:A8,UNIQUE(TRIM(SUBSTITUTE(data,TEXTAFTER(TEXTAFTER(data," ")," "),""))))
In cell D1:
Excel Formula:
=LET(data,A1:A8,names,TRIM(SUBSTITUTE(data,TEXTAFTER(TEXTAFTER(data," ")," "),"")),firstOnes,XLOOKUP(C1#,names,data),TEXTAFTER(TEXTAFTER(firstOnes," ")," "))*1
In cell E1:
Excel Formula:
=LET(data,A1:A8,names,TRIM(SUBSTITUTE(data,TEXTAFTER(TEXTAFTER(data," ")," "),"")),firstOnes,XLOOKUP(C1#,names,data,,0,-1),TEXTAFTER(TEXTAFTER(firstOnes," ")," "))*1
Adjust A1:A8 accordingly
I couldn't try it. I think Office 365 functions are different than old office versions
 
Upvote 0
Xl 2024 (which your profile is showing you use) has all those functions.
 
Upvote 0
it works. Thank you very much
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,226,050
Messages
6,188,571
Members
453,484
Latest member
jlo1673

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