I created the time log for what I do:
To better illustrate, I attached the image as follows:
where start and end are the time when I started the particular task in the column A, and delta is the difference between the values in End and Start.
In the next sheet, I created the the summary of how much time I spent on each criteria like this:
Now the problem I had is:
1) The formula I have in the hour field in the summary sheet is this:
=sumif('Time spent'!$A$2:$A$100,A3,'Time spent'!$D$2:$D$100)
How do I make it so that values are up for the entry put in today? The reason why I want this feature is so that I can see my performance for today.
I have this on Google Doc, but I also would like to know how to get this done in Excel as well
In Excel, starting in version 2007 you can use the SUMIFS function - which allows multiple conditions. In your case, the syntax would be:
=SUMIFS('Time spent'!$D$2:$D$100,'Time spent'!$A$2:$A$100,A3,'Time spent'!$E$2:$E$100,TODAY())
In Excel 2003, you can do this with a SUMPRODUCT:
=SUMPRODUCT('Time spent'!$D$2:$D$100*('Time spent'!$A$2:$A$100=A3)*('Time spent'!$E$2:$E$100=TODAY()))
Related
I have an Excel worksheet where I write down all the hours per day I work on my project.
During one day I just work some minutes here and there.
In one column of my sheet I would like to have the accumulated / added hours I worked at that specific day.
So once a row with day, start, and end is complete, the referring accumulated hours per day for this new row should appear.
I would like to have this cell prefilled, so that I do not have to make any manual adjustments of the contents of this cell.
How has a formula in column accumulated hours per day have to look like to achieve this?
You're looking for this:
=IF(A2<>A1,0,D1)+C2-B2
Ideally, I'd suggest avoiding references in the over row by using OFFSET. Try this instead:
=IF(A2<>OFFSET(A2,-1,0),0,OFFSET(D2,-1,0))+C2-B2
I would suggest creating a pivot table and there you can do many things.
You could also try an array formula version:
=SUBTOTAL(9,OFFSET(C2,0,0,ROW(A2:A9)-1))-IFERROR(SUBTOTAL(9,OFFSET(C2,0,0,MATCH(A2:A9,A2:A9,0)-1)),0)-
(SUBTOTAL(9,OFFSET(B2,0,0,ROW(A2:A9)-1))-IFERROR(SUBTOTAL(9,OFFSET(B2,0,0,MATCH(A2:A9,A2:A9,0)-1)),0))
or more dynamically using Excel 365 Let and Sequence:
=LET(range,A2:INDEX(A:A,COUNTA(A:A)),r,ROWS(range),
SUBTOTAL(9,OFFSET(C2,0,0,SEQUENCE(r)))-IFERROR(SUBTOTAL(9,OFFSET(C2,0,0,MATCH(range,range,0)-1)),0)-
(SUBTOTAL(9,OFFSET(B2,0,0,SEQUENCE(r)))-IFERROR(SUBTOTAL(9,OFFSET(B2,0,0,MATCH(range,range,0)-1)),0)
))
Hey I've been trying to find a way to delete the rows I need via formula without having to do change to much before it works.
When I download CSV, it stores time/date like this:
08:56 29-Sep
07:56 29-Sep
07:15 29-Sep
03:29 29-Sep
09:15 29-Sep
05:15 29-Sep
09:30 29-Sep
06:15 29-Sep
Each one being on a different row.
What I'm trying to do is delete certain rows based on a set criteria.
The criteria being Before 09:00 on today's date, and after 05:00 on tomorrow's date.
Is this possible without splitting the data up?
I've been trying to do it via IF statement, but don't use excel for much more than the basics to be honest.
Teylyn gave a TLDR while I was typing.
The longer answer, like Teylyn suggested is to flag the data.
You can use the HOUR() and ROUND() functions to extract the date/time from the string, then simply perform a simple next And/Or logic IF statement to flag yes/no for the removal.
=IF(OR(D2<0,AND(D2=0,C2<9),AND(D2=1,C2>17),D2>1),"REMOVE","KEEP")
Where column C is the extacted hour ( in 24h format ) and D is days offset from 'current' date using the following
=ROUND(A2,0)-TODAY()
Here's an example worksheet : www.instantexcel.com/downloads/stackexchange/64235111.xlsx
And a screenshot example :Multiple criterea if statement
There are several ways to achieve this.
load all the CSV data into Excel, then sort the data and delete the rows you don't need
load all the CSV data into Excel, then create a formula that flags rows you don't need, then filter the data based on that flag. This will not remove any data, only hide it from view.
load the data into Power Query instead of the worksheet and clean it up in Power Query before loading it to the worksheet.
Formulas cannot delete data. Formulas can help you identify data, and then you can use that for sorting or filtering data.
=COUNTIFS(NETWORKDAYS(C:C, TODAY(), 1),">=" & 5)
I am trying to use something like the above to count any values in Column C (Date column of my dataset) where the working days from then to todays date is greater than 5. Can this be done without creating a working days column?
It's actually not so obvious but NETWORKDAYS does not work with ranges. Arrays however are completely fine. See this post on SuperUser too.
So in your case you could simply use:
=SUMPRODUCT(--(NETWORKDAYS(C:C+0,TODAY())>=5))
Obviously it's better not to reference the whole of column C. Depending if one has Excel O365, you could also just use =SUM instead of =SUMPRODUCT.
Using COUNTIF and VLOOKUP, the goal is to count my inventory of Laptops and return the number I have in stock.
My current formula is this:
=COUNTIF($A$3:$A$10000,H4)
As my table only has one entry for "Laptop", the formula evaluates to 1.
The next step was to incorporate some sort of VLOOKUP for quantity. As an example, Row 17 has an entry for "Monitor" with a specific model, with a column E (quantity) value of 5:
Monitor HP Compaq LA1951G 1FL SVR 5
I could use a VLOOKUP here:
=VLOOKUP(H6,$A$3:$E$10000,5,FALSE)
However, I have a second set of monitors with a different model. From what I understand of VLOOKUP, the formula stops evaluating at the first match.
I'm considering simply listing every possible model in our environment and strictly using VLOOKUP only, but this makes my life more complicated.
Any suggestions on a better way of doing this before I do a lot of manual work would be appreciated. I've linked a sanitized copy of my workbook via Google Sheets here.
I believe the SUMIF() function would be more useful here.
Replace the
=COUNTIF($A$3:$A$10000,H4)
with
=SUMIF(A:E,H4,E:E)
Having done this same process for many companies, I suggest you also consider a Pivot Table. It can automatically update, auto-sum everything, and auto-count everything if you've set it up properly.
Pivot Tables also work in Excel and Sheets equally well. Just make sure that you're defining entire Columns of data for the basis of the data sets and it will be dynamic! E.G. Don't do A1:F50, do A:F for your data set definitions.
Here is my data model: I have an excel sheet with each row representing a date range (an event). There is significant overlap. A2 might be 4/10/15, and B2 might be 4/12/15; while A3 might be 4/11/15 and B3 might be 4/12/15.
I am trying to get a count for each day of the year 2015 how many events occurred on that date. with my limited "for instance" I would get something like:
4/9/15 0
4/10/15 1
4/11/15 2
4/12/15 2
4/13/15 0
I have some sudo code for this if I were to just save the set as a csv and use java or something to grab each date and create an object but I find it hard to believe that excel is not capable of this on it's own.
We tried a wild number of countif and countifs statements but I am really just at a loss when it comes to excel.
I thought I was close with this:
=COUNTIF(Sheet2!A2,AND(Sheet2!A2>=(dates!B*), Sheet2!A2<=(dates!C*)))
but in order to get that to work I would need it to iterate through each row of dates and I am just not sure how to do that.
Any help is appreciated. As a backup plan I am refining my sudo-code for a possible vb excel script (never done that before) or just breaking it out into java and using the old text edit scripts I haven't had to touch since college labs.
Thank you for any help.
Your keyword is COUNTIFS
Say your criteria day is in cell Sheet2!A2 and your event ranges are in sheet Dates columns B and C; Try this formula:
=COUNTIFS(Dates!B:B, "<="&Sheet2!A2, Dates!C:C, ">="&Sheet2!A2)