SOLVED

Compare diffrently structured time periods for errors

%3CLINGO-SUB%20id%3D%22lingo-sub-2273902%22%20slang%3D%22en-US%22%3ECombine%20time%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2273902%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20Excel%20community%2C%3C%2FP%3E%3CP%3Eany%20help%20would%20be%20greatly%20appreciated!%3C%2FP%3E%3CP%3EI%20a%20Excel%20file%20in%20which%20time%20data%20is%20structured%20as%20follows%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Change99_1-1618468815767.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F272987iE9452AAA3178519E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Change99_1-1618468815767.png%22%20alt%3D%22Change99_1-1618468815767.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20need%20a%20way%20to%20structure%20it%20like%20this%20automatically%20(excluding%20zero%20time%20periods%20like%2000%3A00%20until%2000%3A00)%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Change99_0-1618468633037.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F272986i5A3DFC15D2939327%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Change99_0-1618468633037.png%22%20alt%3D%22Change99_0-1618468633037.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ESo%20uninterrupted%20time%20periods%20of%20one%20day%20should%20be%20summarized.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2273902%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2273949%22%20slang%3D%22de-DE%22%3ESubject%3A%20Combine%20time%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2273949%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F968113%22%20target%3D%22_blank%22%3E%40Change99%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20read%20this%20information.%20It%20is%20of%20great%20help%20to%20you%20and%20everyone%20who%20would%20like%20to%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel%2Fwelcome-to-your-excel-discussion-space%2Fm-p%2F2204395%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel%2Fwelcome-to-your-excel-discussion-space%2Fm-p%2F2204395%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%2C%20if%20I%20may%20recommend%20you%2C%20add%20a%20file%20(without%20sensitive%20data)%20and%20explain%20exactly%20what%20your%20plan%20is.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20understanding%20and%20patience%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2274031%22%20slang%3D%22en-US%22%3EBetreff%3A%20Combine%20time%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2274031%22%20slang%3D%22en-US%22%3EThanks%20for%20the%20info!%20I%20hope%20its%20understandable%20now.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2274071%22%20slang%3D%22en-US%22%3EBetreff%3A%20Combine%20time%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2274071%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F968113%22%20target%3D%22_blank%22%3E%40Change99%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20are%20always%20many%20ways%20of%20doing%20this%20in%20Excel.%3CBR%20%2F%3EHere%20is%20a%20small%20example%20with%20pivot%2C%20where%20you%20can%20expand%20the%20table%20and%20continue%20to%20calculate%20all%20times.%3CBR%20%2F%3EThe%20time%20has%20been%20converted%20to%20decimal%20calculation%3A%20(Endtime%20-%20Startime)%20*%2024%3CBR%20%2F%3EYou%20can%20change%20this%20as%20you%20wish%2C%20see%20the%20formula%20in%20the%20table.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20be%20happy%20to%20know%20if%20I%20could%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3CP%3E*%20Kindly%20Mark%20and%20Vote%20this%20reply%20if%20it%20helps%20please%2C%20as%20it%20will%20be%20beneficial%20to%20more%20Community%20members%20reading%20here.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Dear Excel community,

any help would be greatly appreciated!

I have 2 Excel files (attached) that look like the attachted screenshots which I need to compare for any errors. They are the same but they are structured diffrently. There are special cases coded like this: time period 00:00 - 00:00 which should be ignored. Basically the time periods need to be the same. If they are not the same I need to highlight the mistake. In this example they are no errors.

 

*Edit:

I am looking for the following type of error: One file has a time period which is not listed in the other file. The sum of hours for one day could be the same even though the time periods are not the same. I am not proficient in Excel but I think that some kind of Macro which restructers file1 to look like file2 (excluding the 00:00-00:00 time periods) would be good.

 

(File1)

Change99_1-1618468815767.png

 

 

(File2)

Change99_0-1618468633037.png

 

Info:

Windows Version: Microsoft Windows 10 Pro

Excel Version: Microsoft Office Standard 2016

 

11 Replies

@Change99 

Please read this information. It is of great help to you and everyone who would like to help.

 

https://techcommunity.microsoft.com/t5/excel/welcome-to-your-excel-discussion-space/m-p/2204395

 

Then, if I may recommend you, add a file (without sensitive data) and explain exactly what your plan is.

 

Thank you for your understanding and patience

 

Nikolino

 

Thanks for the info! I hope its understandable now.

@Change99 

 

There are always many ways of doing this in Excel.
Here is a small example with pivot, where you can expand the table and continue to calculate all times.
The time has been converted to decimal calculation: (Endtime - Startime) * 24
You can change this as you wish, see the formula in the table.

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

Thank you very much for your quick respond but I think there was a misunderstanding! As I understand it you took the data from file1 and calculated the sum of the time periods and then summarized your findings in the pivot table.
However I need to find the errors when comparing file1 and file2. I am looking for the following type of error: One file has a time period which is not listed in the other file. The sum of hours for one day could be the same even though the time periods are not the same. I am not proficient in Excel but I think that some kind of Macro which restructers file1 to look like file2 (excluding the 00:00-00:00 time periods) would be good.

@Change99 

Have a look at this suggested solution in the inserted file ... although I don't think that's what you are looking for, my knowledge of Pivot ends here.

 

If maybe Mr. Baklan had time :))

 

Thank you for your understanding and patience

 

 

Nikolino

I know I don't know anything (Socrates)

Thanks for trying! Unfortunately, as you suspected, it's not what I was looking for.

Your right Mr. Baklan really is the best!

 There are many very good Excel experts here (do not mean me like Mr. Sergei Baklan.

But such good insider knowledge, and knowledge of almost all Office versions, makes some people irreplaceable :).

As in the saying, "All are replaceable, only some people take a very, very long time" :).

The very good knowledge of English is always an advantage.

 

Since you got your help right away, I recommend that you rate Mr. Sergei Baklan's answer as the correct answer, so that other members can also benefit from it.

 

Thank you for your understanding and patience

 

 

Nikolino

I know I don't know anything (Socrates)

@Change99

@Hans Vogelaar is a master too! He helped me a lot!
But I did mark Baklans response.
best response confirmed by Change99 (Occasional Contributor)
Solution

@Change99 

Not sure I understood correctly what is required. If the goal is to convert range as in File1 to one which is in File2

image.png

(from most left here to most right one), variant could be using formulas:

in F2

=IFERROR(INDEX(B:B,
   AGGREGATE(15,6,1/
    ($B$2:INDEX($B:$B,COUNTA($B:$B))<>$C$1:INDEX($C:$C,COUNTA($B:$B)-1)) /
    ($B$2:INDEX($B:$B,COUNTA($B:$B)) <> 0)  *
    ROW($B$2:INDEX($B:$B,COUNTA($B:$B))),
    ROW()-ROW($F$1)
  )),
"")

copy and paste this cell to E2.

In G2

=IFERROR(INDEX(C:C,
   AGGREGATE(15,6,1/
    ($C$2:INDEX($C:$C,COUNTA($B:$B))<>$B$3:INDEX($B:$B,COUNTA($B:$B)+1)) /
    ($B$2:INDEX($B:$B,COUNTA($B:$B)) <> 0)   *
    ROW($B$2:INDEX($B:$B,COUNTA($B:$B))),
    ROW()-ROW($F$1)
  )),
"")

Select E2:G2 and drag down till empty cells appear.

Yes thats exactly what was needed! Thank you

@Change99 , you are welcome