Count the total times value based on name on google spreadsheet - conditional-statements

I am creating a sheet that will automatically count the time spent from the log file.
I was able to separate the name, action, date and time automatically. I also able to get the time differences. However, since the name maybe repeated more than once, I couldn't find away to automatically count the total time for each name.
On the screenshot the green cells is what I wish to be automated. So it will count the total time for the similar name.

Put it in G2 and apply to the column
=SUMIF(A$2:A2,A2,F$2:F2)

Related

Get only one column of data depending on the date

I have an excel file that is I am greeting weekly and the file column is written as “day01” “day02” and so on. “01” represent the dates and I am only supposed to get that every week depending on what date our calendar is, for instance if today is 5/3/2020 than that means I only will get column “day01” and next week I am suppose to get “day02”. I am using an ssis package with nested for loop and for each loop container. How can I get only one week of data from excel every week depending on the date.
I am stuck I need help please it’s for my school project.
The excel file has the following column
-ID integer unique values)
“day01” (currency)
-“day02” (currency)
-“day03” (currency)
-“day04” ....
I want to get for each ID one week of data that is “day01” which “day01” must much with the calendar, and for next week the same thing.
If it is just for the school project, use variables. Make sure that the loop picks and extracts only the MAX day value (if they are consecutive and each week gets a day n+1 name). It will allow you to extract only the latest week of data (or manually specify which one week you want, for a one time load).
In the real project, I would rather pull all data from the Excel file into a staging table (especially important if the Excel is not auto generated and users have access to it), review and validate, and then take the last week (or any week you need) and work with it further..

Query that returns results that are at least a week apart

I have a google sheets spreadsheet that has lots of user data, timestamped. This data is entered into the google sheet by administration AND end users via a google form, so the data points don't come in at regular intervals. I want to be able to query against this datapool, but limit the results shown based a defined amount of time between result.
So say I wanted to query for Bob, I would get 3 results. Is it possible to query this data in a way that it would see the 11\11 result, but disregard the 11\12 result becuase it's within a week of the previous result? Really I'd like to be able to do this for any timeframe.
Well it's easy enough to do as an ordinary formula that you can pull down like this, but I don't see a way of doing it as a query or array formula:
=iferror(if(istext(F1),index(A$2:A,match(true,(B$2:B=$F$1),0)),index(A$2:A,match(1,(B$2:B=$F$1)*((A$2:A-F1)>=7),0))))
where the person's name is in F1.
This is a fairly rough outline of an answer, I haven't taken account of any time part of the timestamps. The last two dates are only separated by 6 days, but the formula includes the third to last and the last one as mentioned in my comment because they are separated by 7 days.

Excel Macro to combine cells of data when data matches in another column

The best way I can explain my problem is by showing a few screenshots.
I need to turn data like this:
[
Into something that displays like this:
After Data
There are multiple part numbers in the file, and I need the macro to take all the data from a matching part number and transform the data into what is displayed in the second image. All the part numbers are grouped with their data together, so it wouldn't need to run the loop through the top every single time, but adding to the entries with each new piece of data. Something also needs to be done for the years as well, because the way the data is presented, is in a range of years, and I need an entry for each year in that range.
Additional Information:
I am using this data for prep for category data for a BigCommerce site, that is working with a year/make/model plugin on the site, to create a vehicle lookup system. Thus in order for the user to look up their vehicle accurately the categories need to be listed the way they are in the second picture, which needs to be the result of the macro.
I thank anyone who takes the time to look into this, it will cut down the time I spend doing this manually by a huge amount.
You can do this with a formula (without actual VBA):
In cell F2 write: ="YMM/"&C2&"/"&D2&"/"&E2&";"
In cell F3 write: =F2&"YMM/"&C3&"/"&D3&"/"&E3&";"
drag down the formula in F3 until the last row.
The last row will contain the entire string of all vehicles.
I just noticed you may have duplicate values. You can use the built in Remove Duplicates feature to remove those before using the above technique.

Job/Work scheduler/planner for teams

Currently we use an excel spreadsheet with 4 tabs (as tab for each team), each tab is a planner/diary that week, each day has 4 "slots" for jobs that are planned in.
The people type in the information for each job into one of the 4 slotsfor the day. Each slot contains information in different cells; Job No., Address, Duration, Notes, etc...
The issue/time consuming aspect of this method is when jobs have to be moved about between teams or moved to a different day it involves lots of copying, pasting and deleting.
What I am trying to achieve is some form of drag/drop interface (similar to the way the calendar in Outlook works), where the people who use the spreadsheet can input details for the job in a form and then have a drag an drop "tile" to be able to drag into one of the "slots.
The data contained in these slots needs to be able to produce a report which is a linear list of all the jobs planned that week.
I am at a loss to figure out what method I should use to create this, it seems it is beyond the reach of Excel from what I can find, also beyond the reach of Access, so I suspect it will involve some form of programming. I have basic understanding of VBA, but that's about it.
Can anyone make any suggestions.
Thanks
Working with data in this format will always be hard and I would not reccomend adding any drag and drop until you have sorted out the structure of your data.
You might like to consider another approach, which involves restructuring your data to make it easier to work with...
If you had one sheet with the following columns:
Teamname
Date (instead of Week Number and Day of week,)
Timeslot
JobNo
Address
Duration
Notes
Etc
Then each row would represent a job and have details of when it is occurring.
This is way a database would store the information about the jobs that are happening.
To change when a job is happening, all you have to do is update the date (and timeslot) of the row.
You could then create another worksheet for each team that uses excel formulas to lookup jobs happening this week and display them in a column for each day - like you have now. These sheets would be for display purposes only.
(You would use formulas like VLOOKUP etc)
If you want to change the date of a job you then simply go to the worksheet with the long list and change the date.
Having your data in this long list (ie normalised) format will give you many benefits. For instance you can summerise the report of the data using pivot tables.
If you add filters to the long list (SEE Ribbon>>Data>filters) you can order the data and reduce the list to only show jobs on a selected date, or for a selected team etc...
This is definitely the way forwards. Having restructured the data in this way, you could then add flashy ways to change when a job is taking place by adding buttons on the team worksheets or something.
PART2:
So in you ling list I would recommend excel CONCATENATE function to add an extra column with the text you want displayed elsewhere in your "calendar". #COLUMNA
I would also create another column which is a unique identifier for the row. This will probably be the "Date in YYYMMDD format & timeslot in HHMI format" concatenated together.
In the calendar view sheets say you need a column to display each day of the week with a row for each time slot: You need to
enter a StartDate of the period you want to view
Set up a column for each day (with a formula to calculate the date of the day (ie StartDate, StartDate+1 etc). The date is displayed as a column header (perhaps with a format that shows the dayname, but is stores the date)
each row will have a column that has the timeperiod name and each row will have a value entered. The value is the same as those used in the long list's timeperiod column.
When a user double clicks on a cell you can use the worksheet event
Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
in the VBA code, for this event you need to:
see if the cell double clicked is one you want to respond to
if it is find the date and timeperiod from the corresponding column and row header.
use VBA to activate the long list sheet and probably filter to only show the jobs taking place that day or perhaps that week. Then select (or highlight?) the job that was double clicked.
This is quite easy once you know VBA.
There is a lot to know though I would:
use a named range to define the row with the date and another to define the column with the timeperiod
use a named range to define the cells that will respond to a double click
use range functions in VBA like intersection and the entirerow, entirecolumn range properties to find the date and timeperiod of the double clicked cell.
use the macro record to write the initial code that will do the filter.
adjust the code to be well written and to find the date and timeperiod as required.
Create a sheet for all departments? Or just create one sheet where the dept can be chosen.
You could get clever and allow the user to select two cells in the calendar and provide buttons that do things like:
swap the jobs
If they select many cells then a button to Goto the list and only show jobs that were selected in the calendar.
Perhaps the user could select one job and buttons could move the job back or forwards 1,2,7,14 days.
Note that you can use the long list to record other details of the job like time taken, customer, start time, end time etc...
See about Pivot tables here which might give you some ideas about how you can summarise you data to give info like jobs per day, total value of jobs by day, etc...
Before you tie yourself in knots using Excel, you should always consider using Access.... as with someone who know what they are doing, access will deliver a lot more in a shorter period of time and can do nice things like print one page per job etc etc...
(Do you need a contractor?)
mr#HarveyFrench.co.uk

Time column average in access database

I have an access database one table has time column that shows the total time from (endtime - starttime) I need to have that column averaged (hh:mm) ss not needed. I need to store this average into another table, and then be able to display that in a textbox. with conditional formating as far as color for certain time ranges. I'm going to need to do this for a daily range and a monthly range, just wonder what would be the best way to accomplish this. this monthly and daily average will need to update each time the table has records added to it.
My thoughts on this was pull the daily times into an array, then average the array, and store that average in another table. Then use the daily average table to display in a textbox, along with the conditional formatting. and then the same thing for the monthly time average as well.
It is by no means difficult to obtain this information from a query, time is just the decimal portion of a number.
SELECT Format(Avg(CDbl([Atime2])-CDbl([ATime1])),"hh:mm:ss") AS Diff
FROM Table;
Or
SELECT Sum(DateDiff("n",[ATime1],[ATime2])) AS SumMins,
Count([ATime1]) AS CountRecs,
Avg(DateDiff("n",[ATime1],[ATime2])) AS AvgMins
FROM Table;
Furthermore, MS Access 2010 has data macros and calculated columns that are good even outside of Access.
Finally, it is not generally recommended that you store a value that becomes invalid at every edit when the value can easily be calculated.