I am building a scheduling tool for my company. The structure of my Google Sheets document is a summary page with the entire schedule laid out for each employee in each department. Then, each employee gets their own sheet. In each employee sheets I have a section for Sunday, Monday, and Tuesday (the days each employee works). In each section by day I have a column indicating the hours they are on the clock, and then a column for each department. I have placed a checkbox into each cell and can activate the check box to indicate that this employee will be working in that department at that corresponding time. However, there are times when an employee is in a department more than once per day, meaning that the column with the checkboxes has, for example, checks in the cells corresponding to 7am-10am and 2pm-5pm, with unchecked boxes in the cells corresponding to 11am-1pm.
I have query functions that can pull the start and end times in that department if the employee is only in that department once per day. The output, after some concatenation, is something like "7AM-2PM".
=QUERY(A4:C17, "Select MIN(A) where (C=TRUE)")
=QUERY(A4:C17, "Select MAX(A) where (C=TRUE)")
However, I cannot think of a way to discriminate multiple start and end times. Using the above example, I'd like my output to be "7AM-10AM" and "2PM-5PM". These can be in separate cells or the same cell, doesn't make a difference to me. There can also be formulas in several cells if a subsequent formula needs to operate off a previous one.
I hope this makes sense in the way I have described it. I have been struggling for weeks trying to come up with something and am running out of time. Thanks for any and all help!
try:
=ARRAYFORMULA(IFNA(TEXTJOIN(CHAR(10), 1,
TEXT(FILTER($A4:$A17, IF((B4:B17=TRUE)*({FALSE; B4:B16}=FALSE), 1, )=1), "hh:mm\ - ")&
TEXT(FILTER($A4:$A17, IF((B4:B17=TRUE)*({B5:B17; FALSE}=FALSE), 1, )=1), "hh:mm"))))
Related
I have an attendance tracker in which I'm trying to account for each employee type per day.
I have a summary page (sheet1) in which I want the count of each type (A,B,C,D,E) based on the day in cell C2 whether or not they have an X on sheet2 for that day.
Using =COUNTIF(FILTER(Sheet2!$A$5:$GG$969,Sheet2!$A$5:$GG$5=$C$2),"X") I am able to get a total of "X" based on the date in cell C2.
However, I'm having trouble getting the formula to work counting each employee type.
=COUNTIFS(Sheet2!A5:AM31,A7,(FILTER(Sheet2!A5:AM31=C2)),"X")
This gives me an error "Array arguments to COUNTIFS are of different size."
I'm not sure how else to configure this. Below is a link to my sample sheet:
Appreciate any help!
https://docs.google.com/spreadsheets/d/1OdJTwbFsNcR1hO1qzMBGUY4iXcWgDwIAJmBAVE9cs0k/edit?usp=sharing
I think this would work, dragged down for the other groups.
=COUNTIFS(Sheet2!A$6:A$31,A7,FILTER(Sheet2!$6:$31,Sheet2!$5:$5=C$2),"X")
However, I would encourage you to look at this sample sheet (a copy of yours) where I've added a new tab called MK.Help, designed to be hidden, but used as a sort of helper tab to make all sorts of things you might like to do easier. Including the count you asked about.
It has one single formula in cell A2 where you can see what it does.
=ARRAYFORMULA(QUERY(SPLIT(FLATTEN(Sheet2!C5:5&"|"&Sheet2!A6:A31&"|"&Sheet2!B6:B31&"|"&Sheet2!C6:31),"|",0,0),"where Col3<>'' order by Col1"))
try:
={"", ""; QUERY(FILTER(Sheet2!A6:A31, FILTER(Sheet2!6:31, Sheet2!5:5=C2)="X"),
"select Col1,count(Col1) where Col1 is not null group by Col1 label count(Col1)''");
"Total", COUNTA(IFNA(FILTER(Sheet2!A6:A31, FILTER(Sheet2!6:31, Sheet2!5:5=C2)="X")))}
I have a large spreadsheet containing job information. I am trying to make a "Job Count by Month" field, and it doesn't pull correctly.
My Job Info is all located in a sheet called "3PL Jobs". I have a hidden sheet titled "Under The Hood" which contains a table of months next to their names (i.e. 'Under The Hood'!E2:E13 is a column of numbers and the F column has the corresponding "January","February", etc.
I've made a cell with a dropdown list of the months (pulling from the Under The Hood sheet) and in the cell directly to the right I want it to output the number of completed jobs.
I got this working with the dropdown month list being just a simple list of numbers and not the name, but it looks awful so I was hoping to use an index match to be able to use the name.
This is the code that worked with a list of month numbers, using I19 as the entry cell for the month number
=COUNTIFS(ARRAYFORMULA(MONTH('3PL Jobs'!C3:C)),I19,'3PL Jobs'!AR3:AR,"COMPLETE")
This is the code I've tried to include to index/match the month name (this in theory should just output the month number based on the name selected in I18, but it outputs "8" no matter what is selected)
=arrayformula(index('Under The Hood'!E2:E13,MATCH(I18,'Under The Hood'!F2:F13),1))
I'm sure I'm missing something simple, but this is driving me nuts!
to turn month name into month number all you need is:
=MONTH(I18&1)
I am trying to match date and time, and metric category with multiple rows in a data sheet. Currently, I record metrics every day in a similar function with a set of rows showing metric data based on intervals of time. These rows are broken up by date.
I would like to be able to add to a dashboard the current metrics without someone needing to dig through the tables I am recording in. This would require the metric to stay up there until the next interval changed.
I will use =SPLIT(NOW) for the date and time but for now I would like to at least get this to work with static interval and date. I tried using Index Match using AND(), & etc and I cannot get it to work. I also tried to use an array but it errors every time.
Google Sheets Index Match Multi Criteria
If the time intervals for each day will be exactly the same and the data structure will never change with 3 identical lines per day (as per your screenshot) than I think you are overcomplicating things a little:
B2:
=index($A$7:$E$15,MATCH($A$1,$A$7:$A$15,0)+1,MATCH(B$1,$A$7:$E$7,0))
B3:
=index($A$7:$E$15,MATCH($A$1,$A$7:$A$15,0)+2,MATCH(B$1,$A$7:$E$7,0))
B4:
=index($A$7:$E$15,MATCH($A$1,$A$7:$A$15,0)+2,MATCH(B$1,$A$7:$E$7,0))
Imagine a one-table query that accepts a year (range) as a parameter and then yields a dataset grouped by State, City, and Month, with a count of UFOs, if any, for each month.
Tie that dataset to an SSRS Tablix, with a crosstab layout:
The Row Groups are State, City;
The Column Group is the Month (Jan through Dec); and
The row-column intersections are the # of UFOs sighted, if any.
PROBLEM:
If I run the (parameterized) report for one location, even one with few sightings, all goes well: I see columns only for months with sightings.
However, if I report more than one location (say, "Albany," with daily sightings, and "Troy," with October-only), Troy's grouping will come out ugly: If reported alone, just the October column would show, but, now, October along with 11 columns of "#Error" for the month name and a "0" for UFO count appear.
I suspect that one solution may involve some 0- or NULL-fill of missing-month data for Troy and other cities (How?), but is there some other way, via the Tablix widget, to achieve the desired result?
I don't understand what you're doing wrong but the matrix usually works with filling the headers correctly and leaving blanks where there is no data for a single group.
It might help if you show your design view.
Design View:
Report View:
Many of the users don't have data for previous months but at least one does so the month is displayed in the header. The blanks are where there is no data for that month/user combo.
I don't see why your report isn't working like this. If I only selected one user, then only the months that user had will be displayed.
I've been scratching my head for a few hours with a couple of very time consuming issues.
I have a sumproduct formula totalling the number of bookings within a month and a year, and another doing the same but totalling the profit instead of the number of bookings.
the formula for each is below:
Bookings
=SUMPRODUCT(--(BAU!$X$3:$X$10000<>""),--(MONTH(BAU!$X$3:$X$10000)=1),--(YEAR(BAU!$X$3:$X$10000)=2013))
Profit
=SUMPRODUCT(--IF(ISNUMBER(BAU!$AA$3:$AA$10000),BAU!$AA$3:$AA$10000),--(MONTH(BAU!$X$3:$X$10000)=1),--(YEAR(BAU!$X$3:$X$10000)=2013))
two issues I have, firstly, I have about 300 Cells I with such formulas, these cover clients for each month and each year, activating these with control shift enter takes a LONG time individually, When I attempt to activate all of them at once, the month and year criteria in the formulas e.g. (=1 & =2013) is duplicated across every cell, so instead of searching for each month, every cells only queries against =1 (january), can this be avoided?
Secondly, after manually control shift entering EVERY cell and saving/closing the workbook, the #VALUE error is in every cell when I reopen it, meaning I have to repear the whole CSE process.
Any help would be greatly appreciated, sorry if I've not made much sense, I tried my best to.
If looks like this is what you want
=COUNTIFS(BAU!$X$3:$X$10000,">=1/1/2013",BAU!$X$3:$X$10000,"<=1/31/2013")
And
=SUMIFS(BAU!$AA$3:$AA$10000,BAU!$X$3:$X$10000,">=1/1/2013",BAU!$X$3:$X$10000,"<=1/31/2013")
you do not need to enter these as arrays just as normal formulas.
If you need to Change the dates ever I would do something like the following:
In A1 (Or what ever cell you'd like to enter the date in) Right click the cell and click Format Cells..., Then under the "Number" Tab (usually the tab it will open too) click on Custom. Then enter "m/y" Where it says Type:.
From there you enter a month and a year into the cell.
Then modify the formulas to this
=COUNTIFS(BAU!$X$3:$X$10000,">="&A1,BAU!$X$3:$X$10000,"<="&A1+30)
And
=SUMIFS(BAU!$AA$3:$AA$10000,BAU!$X$3:$X$10000,">="&A1,BAU!$X$3:$X$10000,"<="&A1+30)
Replace A1 With the cell you choose to enter the date in. Enter the date as "1/13" for this example.