How to create a proper excel table from unorganized data?

Sochen

Board Regular
Joined
Dec 6, 2022
Messages
66
Office Version
  1. 2021
Platform
  1. Windows
Hi All,

I have the report data which is recording staff fingerprint in and out. However, that report is not organize properly as it did not show whether the staff comes to work late or come back from break-time late.
So I want to make the excel table which will calculate the staff who will come to work late from the unorganized data table as below:

I am not sure if there is any possible formula or data transform or VBA to get it done.
Thank you so much!

Data -1.xlsx
ABCDEFGHIJKLMNOPQR
1
2ShiftFromTo
3Morning08:3017:30
4Evening13:0022:00
5
6Table 1: Raw data from systemTable 2: Result
7Break time (1 hour)
8NameClock LogIDRemarkLocationDateNameIDLocationTime InTime OutTime In2Time Out3Total Working hoursLate (in mn)Late Time after break (in mn)
9Russell01/05/2024 08:262222CC01-May-24Russell2222CC8:3613:2114:1817:328:566.000.00
10Russell01/05/2024 13:212222CC05-May-24Russell2222CC12:4916:2117:1822:159:260.000.00
11Russell01/05/2024 14:182222CC06-May-24Russell2222CC8:1613:2314:3117:349:180.008.00
12Russell01/05/2024 14:282222CC07-May-24Russell2222CC8:0213:1814:2117:419:390.003.00
13Russell01/05/2024 17:322222CC
14Russell05/05/2024 12:492222CC
15Russell05/05/2024 13:122222CC
16Russell05/05/2024 16:212222CC
17Russell05/05/2024 17:182222CC
18Russell05/05/2024 17:482222CC
19Russell05/05/2024 22:152222CC
20Russell06/05/2024 08:162222CC
21Russell06/05/2024 13:232222CC
22Russell06/05/2024 14:312222CC
23Russell06/05/2024 17:342222CC
24Russell07/05/2024 08:022222CC
25Russell07/05/2024 08:222222CC
26Russell07/05/2024 13:182222CC
27Russell07/05/2024 14:212222CC
28Russell07/05/2024 14:222222CC
29Russell07/05/2024 17:412222CC
Sheet1
Cell Formulas
RangeFormula
P9:P12P9=O9-L9
Q9:Q10Q9=IF(I3>=L9,0,(HOUR(L9-I3)*60)+MINUTE(L9-I3))
R9:R12R9=IF(M9+TIME(0,60,0)>=N9,0,(HOUR(N9-M9)*60)+MINUTE(N9-M9)-60)
Q11Q11=IF(I3>=L11,0,(HOUR(L11-I3)*60)+MINUTE(L11-I3))
Q12Q12=IF(I3>=L12,0,(HOUR(L12-I3)*60)+MINUTE(L12-I3))
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
the data you have is not "unorganized" - it is just a redings log.
However, it lacks important elements to allow for analyzing and summarizing:
  1. You need to know and MARK somehow which one is IN and which one's OUT. And to be honest I think the readings you chose for IN/OUT are arbitrary. Even better will be to mark them IN1/OUT1 and IN2/OUT2.
  2. What are the readings you have left out (uncolored)? Also normally you should have an even number of records each day (INs = OUTs), but on 01.05.2024 you have five records. So another thing to do to allow for analyzing is to mark faulty records which should not be taken into account.
At least you have to mark all valid INs and OUTs in a helper column.
After this is done you can use complicated formulas, PowerQuery, PivotTables, VBA ... basically anything to make a summary table utilizing the automation tools at your disposal.
 
Upvote 0
the data you have is not "unorganized" - it is just a redings log.
However, it lacks important elements to allow for analyzing and summarizing:
  1. You need to know and MARK somehow which one is IN and which one's OUT. And to be honest I think the readings you chose for IN/OUT are arbitrary. Even better will be to mark them IN1/OUT1 and IN2/OUT2.
  2. What are the readings you have left out (uncolored)? Also normally you should have an even number of records each day (INs = OUTs), but on 01.05.2024 you have five records. So another thing to do to allow for analyzing is to mark faulty records which should not be taken into account.
At least you have to mark all valid INs and OUTs in a helper column.
After this is done you can use complicated formulas, PowerQuery, PivotTables, VBA ... basically anything to make a summary table utilizing the automation tools at your disposal.
Hello!

Thank you so much for your response!
1. yes, I just randomly select the time record to put into table because we should have only 4 times record 2 times record for report to works and off from work, and another 2 for break times. However, there are possibility that staffs scan more than requirement and system will record base on what they scan. Just like what you have mentioned still can mark them In1/Out1 and Int2/Out2.. And all the data can input into the table without randomly select.
2. Just what I have mentioned in point 1, I only randomly select the correct procedure of the time record because some days will have more than 4 records.

I would highly appreciate it if u could share me the solution.
 
Upvote 0
A reminder:

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
A reminder:

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
Dear Sir,

My sincere apologies.
 
Upvote 0
Dear Sir,

My sincere apologies.

I was thinking about creating a spreadsheet to give you some suggestions but then I saw RoryA's comment above. If he had never pointed out that you had cross posted to another forum, I would have wasted all kinds of time coming up with a solution for you. Keep in mind that people like myself volunteer our time here - we do not get paid for any of this. Why should I waste my time replying to your thread when you already have an answer? I hope you understand now why it's important to disclose such things when you post a question here.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,194
Members
452,616
Latest member
intern444

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