sort out attendance logs of staff

sumsaam

Board Regular
Joined
Dec 31, 2012
Messages
82
Office Version
  1. 2010
Platform
  1. Windows
27-04-2023.xlsx
ABCDEFGHIJKLMNO
1Source
2Target
3Emp IDFirst NameDateTimeID1
41Sumsaam01-04-202311:00NameSumsaam
51Sumsaam01-04-202311:53Date1234
61Sumsaam01-04-202323:06First log before 8:00AM if any00:48
71Sumsaam02-04-202312:061s log after 8:00AM11:0012:0611:17
81Sumsaam02-04-202322:432nd log11:5322:43
91Sumsaam04-04-202300:483rd log23:06
101Sumsaam04-04-202311:174th log
113Mustafa01-04-202311:235th log
123Mustafa01-04-202323:066th log
133Mustafa02-04-202312:48ID3
143Mustafa02-04-202322:32NameMustafa
153Mustafa03-04-202300:59Date1234
163Mustafa03-04-202316:34First log before 8:00AM if any00:59
173Mustafa04-04-202312:081s log after 8:00AM11:2312:4816:3412:08
183Mustafa04-04-202322:362nd log23:0622:3222:36
193rd log
204th log
215th log
226th log
23
24
Sheet




Hi,
I have data in form of source table and i want to convert that data in target table through formula, Thank you
 
27-04-2023.xlsx
ABCDEFGHIJKLMNOPQRSTUV
1Source
2TargetMonth4
3Emp IDFirst NameDateTimeID3
43Mustafa01-04-202311:23NameMustafa
53Mustafa01-04-202323:06Date01020304050607080910
63Mustafa02-04-202312:481st log before 8:00AM if any3         00:02
73Mustafa02-04-202322:321s log after 8:00AM311:2312:4811:5912:0811:0811:0615:2011:1212:53 
83Mustafa03-04-202311:592nd log323:0622:3216:3422:3622:3922:4123:0023:50  
93Mustafa03-04-202316:343rd log3
103Mustafa04-04-202312:084th log3
113Mustafa04-04-202322:365th log3
123Mustafa05-04-202311:086th log3
133Mustafa05-04-202322:39ID4
143Mustafa06-04-202311:06NameAfaq
153Mustafa06-04-202322:41Date01020304050607080910
163Mustafa07-04-202315:201st log before 8:00AM if any4         00:08
173Mustafa07-04-202323:001st log after 8:00AM411:0712:0512:2111:2011:0811:1415:1614:2912:3612:23
183Mustafa08-04-202311:122nd log423:1722:4822:42 22:3912:2023:0123:55 23:57
193Mustafa08-04-202323:503rd log4     12:41    
203Mustafa09-04-202312:534th log4
213Mustafa10-04-202300:025th log4
224Afaq01-04-202311:076th log4
234Afaq01-04-202323:17
244Afaq02-04-202312:05
254Afaq02-04-202322:48
264Afaq03-04-202312:21
274Afaq03-04-202322:42
284Afaq04-04-202311:20
294Afaq05-04-202311:08
304Afaq05-04-202322:39
314Afaq06-04-202311:14
324Afaq06-04-202312:20
334Afaq06-04-202312:41
344Afaq06-04-202313:55
354Afaq07-04-202315:16
364Afaq07-04-202323:01
374Afaq08-04-202314:29
384Afaq08-04-202323:55
394Afaq09-04-202312:36
404Afaq10-04-202300:08
414Afaq10-04-202312:23
424Afaq10-04-202323:57
43
Sheet1
Cell Formulas
RangeFormula
L5L5=DATE(2023,O2,1)
M15:U15,M5:U5M5=1+L5
L6:U6L6=IFERROR(AGGREGATE(15,6,1/(1/((--(L$5=$C$4:$C$42))*(--($K6=$A$4:$A$42))*(--($D$4:$D$42<TIME(8,0,0)))*($D$4:$D$42))),1),"")
L7:U8L7=IFERROR(AGGREGATE(15,6,1/(1/((--(L$5=$C$4:$C$42))*(--($K7=$A$4:$A$42))*(--($D$4:$D$42>=TIME(8,0,0)))*($D$4:$D$42))),ROWS($L$7:L7)),"")
K6:K12K6=L$3
L15L15=DATE(2023,O2,1)
L16:U16L16=IFERROR(AGGREGATE(15,6,1/(1/((--(L$15=$C$4:$C$42))*(--($K16=$A$4:$A$42))*(--($D$4:$D$42<TIME(8,0,0)))*($D$4:$D$42))),1),"")
L17:U19L17=IFERROR(AGGREGATE(15,6,1/(1/((--(L$15=$C$4:$C$42))*(--($K17=$A$4:$A$42))*(--($D$4:$D$42>=TIME(8,0,0)))*($D$4:$D$42))),ROWS($L$18:L18)),"")
K16:K22K16=L$13


Hi
I have diagnosed the issue and traced. its a format issue. the source table is exported my attendence machine is in text format, when i change format of source table into desired format, it does not returns values into target table. when i press F2 then Enter key in every singe Cell of source table, then actually it changes the format then show results in target table. what is this problem
 
Last edited:
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
what is this problem
Excel treats times and dates as numeric values; however, it is possible for cells to appear as either of those (dates or times) but actually be formatted and treated as text. In those cases, errors will occur if we are treating them as numbers. As a quick check, use an unmodified version of your worksheet (one where you have not performed the F2 operation) and go to some empty cells and enter =TYPE(B4) in one cell, =TYPE(C4) in the next cell, and =TYPE(D4) in the next cell. This will return the data types present in B4:D4. We know B4 has a staff member's name in it, so it is text, and text has the data type code of 2. Numbers have a data type of 1. You should have results of 2, 1, and 1. But it sounds as if you really have 2, 2, and 1?

Often when importing information from other systems, you will need to clean up the data and confirm that all entries have the desired formats. Typically, Excel will attempt to "interpret" imported data and treat it appropriately as text, a date, a time, or a basic number (the latter three are all numbers internally, although they have different displayed formats). Sometimes this interpretation does not work as desired, and often with exported data, some hidden characters can be attached to data that appears to be numeric, but the hidden characters can prevent Excel from interpreting the data as a number when it is imported. The process to clean the data and ensure correct conversion into the desired data types is not always straightforward.

Here is the first thing I would try. Enter the number 1 somewhere on your worksheet and copy it to the clipboard (again, use a bad version of the worksheet where the dates are being treated as text). Then select the entire column of apparent "dates" (that are being treated as text) and select Paste Special and choose the Multiply option in the Paste Special popup window. This forces a multiplication of all entries by 1, so Excel will automatically reinterpret the text-dates and numbers, multiply those dates by one, and then return the numeric value for the date...if you are lucky. If this works, then you will probably want to re-select these cells and reformat them with a short date format so that they appear as conventional dates again. Let me know if this works, or if the text-dates do not convert. And if this does work, then you will need to add these processing steps when the worksheet is updated.
 
Upvote 0
I think that when you have a number or date that is imported as text that excel still thinks it is text even if you change the format to "general".
You can select each column and use text to column to convert them to numbers.
 
Upvote 0
when i press F2 then Enter key in every singe Cell of source table, then actually it changes the format then show results in target table. what is this problem

Intead of doing F2 in every single cell do a text to columns as suggested by @awoohaw , uncheck all deliminators and then finish.
 
Upvote 0
Text to column method clears format bugs and data starts showing, is there anyway to clear this fault? i want just to export attendance log file and paste it to destination worksheet. i tried to paste just values in paste special, but not working
 
Upvote 0
Thank you very much All guys i have solved the problem in doing this in two steps, i have multiplied source table with 1 and after multiplication it works fine. thank you
 
Upvote 0
We're glad to hear that you have it working. It is not uncommon to encounter this type of issue when importing (or pasting) data from elsewhere. Above, you have seen some ideas that often help to resolve the problem. Now that you know multiplying by 1 works, you could set up your sheet to paste values into the desired cells and then recreate the problematic column(s) (is it only the date column C?). By "re-creating", I mean to establish a standing new column (say column E), where a formula in column E simply multiplies column C by 1. Then all formulas that rely on the date would be revised to use the numerical date in column E. This would allow you to achieve the one-step process you desire.
 
Upvote 0
Excel treats times and dates as numeric values; however, it is possible for cells to appear as either of those (dates or times) but actually be formatted and treated as text. In those cases, errors will occur if we are treating them as numbers. As a quick check, use an unmodified version of your worksheet (one where you have not performed the F2 operation) and go to some empty cells and enter =TYPE(B4) in one cell, =TYPE(C4) in the next cell, and =TYPE(D4) in the next cell. This will return the data types present in B4:D4. We know B4 has a staff member's name in it, so it is text, and text has the data type code of 2. Numbers have a data type of 1. You should have results of 2, 1, and 1. But it sounds as if you really have 2, 2, and 1?

Often when importing information from other systems, you will need to clean up the data and confirm that all entries have the desired formats. Typically, Excel will attempt to "interpret" imported data and treat it appropriately as text, a date, a time, or a basic number (the latter three are all numbers internally, although they have different displayed formats). Sometimes this interpretation does not work as desired, and often with exported data, some hidden characters can be attached to data that appears to be numeric, but the hidden characters can prevent Excel from interpreting the data as a number when it is imported. The process to clean the data and ensure correct conversion into the desired data types is not always straightforward.

Here is the first thing I would try. Enter the number 1 somewhere on your worksheet and copy it to the clipboard (again, use a bad version of the worksheet where the dates are being treated as text). Then select the entire column of apparent "dates" (that are being treated as text) and select Paste Special and choose the Multiply option in the Paste Special popup window. This forces a multiplication of all entries by 1, so Excel will automatically reinterpret the text-dates and numbers, multiply those dates by one, and then return the numeric value for the date...if you are lucky. If this works, then you will probably want to re-select these cells and reformat them with a short date format so that they appear as conventional dates again. Let me know if this works, or if the text-dates do not convert. And if this does work, then you will need to add these processing steps when the worksheet is updated.
Thank you very much i have solved the problem in doing this in two steps, i have multiplied source table with 1 and after multiplication it works fine. thank you
 
Upvote 0
We're glad to hear that you have it working. It is not uncommon to encounter this type of issue when importing (or pasting) data from elsewhere. Above, you have seen some ideas that often help to resolve the problem. Now that you know multiplying by 1 works, you could set up your sheet to paste values into the desired cells and then recreate the problematic column(s) (is it only the date column C?). By "re-creating", I mean to establish a standing new column (say column E), where a formula in column E simply multiplies column C by 1. Then all formulas that rely on the date would be revised to use the numerical date in column E. This would allow you to achieve the one-step process you desire.
Well, I have to multiply All columns with 1. All values were in bad format. Like ID,Date and time.
 
Upvote 0
you can record a macro and save it to your personals macro folder to perform the text to column function in a matter of moments.
Creating and saving the macro would take a few minutes, but after that it is just a few clicks.
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,845
Members
449,471
Latest member
lachbee

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