add and subtract values in xml string

Posted on 2015-02-09
Medium Priority
Last Modified: 2015-02-11
Hey guys
A little programming question.  I have a fingerprint time clock that outputs to a xml file that is formatted for spreadsheets.  Problem is this.  If a person clocks in first thing in the morning and clocks out for lunch and then back in and back out at the end of the day, the Time clock puts all the time values inside one cell, or string (if you open it with Notepad).  Is there a way to take this data and calculate a total time at work for that one day?  Or am I stuck with manually calculating it up.
Question by:jonmenefee
  • 5
  • 3
LVL 18

Accepted Solution

Simon earned 2000 total points
ID: 40599597
What does the string look like in notepad?

Is it like "09:00 12:01 13:01 17:15"

Does it store the date in a separate cell?

Are there incomplete records such as
"13:00 18:01 19:04"
where someone logged in but forgot to log out at the end of their shift or worked through until after midnight?

Can you post a sample of the Excel file? It should be possible to split the values, but need to see the data we're dealing with.

Author Comment

ID: 40599641
Here it is.  Thanks for the help so far :-)

Author Comment

ID: 40599643
oops :-)
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Author Comment

ID: 40599647
dang, it wont let me upload.  I will try again.
LVL 18

Expert Comment

ID: 40600858
Hi, it is possible to split those values to get the individual time elements, but the sample has an odd mixture of duplicated entries and unpaired values. Is this because the system is not yet live?
TimesheetXML.pngI have to query this to establish how you want to deal with the following cases:
1. Unpaired values (perhaps login but not logout or vice versa). Should this produce a zero result?
2. Odd numbers of entries (as on 9th), which also imply an unpaired login or logout
3. Multiple instances of the same time value (as on 9th) - should all but the first instance be disregarded?

Author Comment

ID: 40604479
how you are seeing it is how it shows up on the big report.  Turns out there is a summary report that I didn't know about.  It summarized everyones time into a grand total of hours for each person.  So, I don't need to do any programming..   thank god :-)

Author Closing Comment

ID: 40604483
His questions prompted me to dig deeper into the system and I found what I was looking for.  Therefore points should go to him :-0
LVL 18

Expert Comment

ID: 40604488
LOL - glad for you :)

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.

619 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question