How to reflect multiple cells based on specific criteria - google-sheets

Imagine a list on the left filled with employees going down the spreadsheet and headers across the top based categorized on infractions that an employee might violate. this sheet is connected to another sheet which adds a one every time a form is submitted against the employee adding up for the quarter. So employee john smith has across his row would show a 0 if he never committed this infraction and add a 1 to the column each time he did so a row might look like this. John Smith 0 4 5 0 1
The goal is to show the experts name and infraction with how many times this infraction took place removing the infractions that he did not commit so ideally it would look like John Smith 4 5 1 and the header of each number would show what he did.
The goal is to make it much easier to see who did what essentially. There will be over 100 employees and alot of 0's so optically it would look better to distill in order to quickly identify who did what and how many times.
Any ideas?
V lookups and important ranges based on if this is greater than 0 is tedious and does not exactly pull what we want. Essentially omitting the 0s and just showing what an employee has done rather than what they have not done is the goal. All index and match formulas do not seem to specifically answer this problem
simple Index V lookups and matching formulas have been tried
Not able to reflect all three variables (employee/frequency/infraction) while not showing on a master list the people who did not commit the offense

There's a few ways you could set this up. I would set this up so it
Column A = Employee
Column B = Infraction
Column C = 1
Column D = Date
That way you can do a pivot summary and have the employees, with their infractions below their name and the months/years they occurred. Also you can adjust this table as necessary, such as filter by the employee name or by date or by infraction.
The added benefit is you could create a chart with all of these as filters, like cutoff a date range or pick an employee or infraction and it can show a bar graph of all the infractions by month or something like that.

I would agree that listing your data of infractions line by line (as they happen) and using a pivot table would probably be the easiest.
You could also use the AGGREGATE function to pull from a large database as well. This way you could type in an employees name, and a list of all infractions would pop up next to the name (or wherever you would want it) with as much detail as you would like. This way is more complex, but using both a pivot table and the AGGREGATE function might get you the best of both worlds (you could searching infraction types, dates, employees, employee types, and get all the details in the world if wanted).
Hope this helps!
JW

Related

Google Datastudio show empty row combinations

I am creating a Google Data Studio report for a car dealership and I have a problem.
I have made these 3 screenshots to illustrate:
If you see on the first screenshot, the datasource is pretty simple, used/new indicates weather the car being sold is new or used and if it is a sportscar or family car, and exchange/clean deal indicates weather the dealership takes/buys the customers old car in for a trade off in price. The rest should be self explanatory.
On screenshot2-3 you see my report, I have one table for each salesperson and it shows the amount of sales for each combination that has sales.
The problem is this, I want the tables to show each combination even if it does not have any sales at all, it should just show 0 then in record count. Like Mike on the left has more combinations than john, I still want Johns table to show those combinations just with a 0 then, and it should be sorted the same on each table so they look the same, just different data in the cells.
Is this possible to do?
To solve this problem, you need to make a combination of data, from the database with itself. Your main analysis dimension, which will generate your combinations, is used/new and Exchange/Clean deal. So your combination should be:
The filter defined in the second database (right base) must contain a filter telling which person the table will be destined for. So, for each table, you must make a new combination that contains the person-specific filter.
I just took a sample from your original database (10 first lines) and the result is:

How to iterate cells in a Google sheet formula?

I'm creating a solution to automatically detect conflicts in a schedule created with Google sheets. A "conflict" means that in the same day at the same time different lessons are supposed to have same teacher or to be in the same room. For instance, in the table below groups 1 and 2 are supposed to be in room 2 at the same time, which should be indicated as "conflict".
Monday Tuesday ...
room subject teacher tutor room subject teacher tutor ...
(group1)
09:00-10:00 1 math Smith Black
10:00-10:45 2 science Stones Moore
...
(group2)
10:00-10:45 2 math Smith Taylor
10:55-11:40 1 reading Anderson Harris
...
To check if there are any "same teacher" conflicts, I've added the following formula:
=if(OR(ARRAYFORMULA(D7={D19;D29}));"at this time teacher has another class for _ group";"ok")
However, such solution has some drawbacks.
The main one is: the {D19;D29;...} array is formed manually which is not nice, at least very fragile. If a line is added in the middle of the schedule, most of the checks will break. What I want to do instead is to get the necessary lines by filtering those with the same time in column A and then get cells D to compare.
Another one is, I can't get (and show) the "conflicting" group which this teacher also is supposed to teach (unless I manually create another array, corresponding to {D19;D29;...} which is more manual work), see _ in the formula.
My question is, can I create some form of loop/iterating in Google sheets to deal with this issues in some convenient coding manner? Or may be you'd suggest another approach to this?
There is a tab on the sample sheet called Conflict Finder (Simpler) where you will find this formula in cell G3, and a very similar one in H3.
It counts instances of a common timeslot and teacher name and if it's more than 1, it outputs the word "Conflict"
=ARRAYFORMULA({"Teacher Conflicts";IF(COUNTIFS($A4:$A;$A4:$A;D4:D;D4:D)>1;"Conflict";)})
Once columns with the array formula are created, you can apply conditional formatting with custom formula to highlight the conflicting cells and hide the auxiliary columns. For instance, for range D4:D1000 apply =LEN(G4) to give red background (in fact, range D4:E1000 also works since column H contains conflicts for column E).

In Google Sheets, how to list and sum values in some rows but not others depending on string?

I am trying to join gained level for names in a list.
Some names are the same person who has changed handle and the scores should be summed.
I have created a sheet to track levels for players in rankings over time.
My implementation is not as clever as I would like it to be.
Also, there is a problem with some players changing names.
Example Sheet
Currently, I have
=SORT(UNIQUE({}))
In order to produce just one of each name in a list
In the cell next to that I'm using
=IFERROR(INDEX(MATCH())) + IFERROR(INDEX(MATCH())) + IFERROR(INDEX(MATCH()))
to the sum of levels for each name across several ranges /sessions.
In the example sheet, N7 and N10 is the same person but my SORT, INDEX, as well as QUERY cannot handle this. I would like to (manually type in the names as strings that belong to the same person) and that the latest handle is the one used in query output together with the sum of all gains.
Any direction pointers or suggestions as to how I could improve my current implementation or even solve the problem I'm having would be appreciated.
=ARRAYFORMULA(QUERY({Ranking!CF4:CF200\ SUBSTITUTE(Ranking!CG4:CG200; "N7"; "N10")};
"select Col2,sum(Col1)
where Col2 is not null
group by Col2
label sum(Col1)'',Col2'Total levels gained since 15 April 2018'"; 0))
Might not suit you (could mean an extra column per month) but one way would be to to use a lookup table. That is enter whatever name suits you, lookup the 'standard' for that name and drive further analysis off that.

PowerBI counts rows in non related table including filtering and non-matches

I have two tables in PowerBI and a slicer, presented below in an abstracted way.
I want to know the number of orders placed for a customer in a given date range. This data is a sample for illustration - there are actually around 10,000 Customers and 500,000 Orders and both tables have many other fields, Ids etc.
My challenge -
Whilst this is easy enough do by relating the tables and doing a count, the difficulty comes in when I still want to see customers with 0 orders and on top of that I want this to work within a date range. In other words, instead of the customers with no orders disappearing form the list, I want them to appear in the list, but with a 0 value, depending on the date range. It would also be good if this could act as a measure, so I can see the number of total customers that have not ordered on a month by month basis. I have tried outer joins, merge queries, cross joins and lookups and cant seem to crack it.
Example 1: If I set the order date slicer to be: 02/01/2017 to 01/01/2018 I want the following results
Example 2: If I set the order date slicer to be: 03/01/2017 to 06/01/2017 I want the following results
Any help appreciated!
Thanks
This is entirely possible with a Measure. When you're using the Order field to count the rows for each customer, you're essential doing a COUNTROWS() function.
With your relationship still active, we can Prefix this in a measure to check for the blanks, and in those cases, return 0. something like this would work
Measure = IF(ISBLANK(COUNTROWS(Orders)),0,COUNTROWS(Orders))
In this case, 'Orders' is the table containing the Order and Order Date fields

Conditional Query and Retrieval

I'm making a Google Sheet for our handyman business and need to collect totals on multiple client labor and material activities. I have a pretty decent sheet going, but, since we work for different clients on different days, with lots of other information in between, it would be nice if I could make a cell collect totals from any cell that has their name at the top of the column instead of chasing all over the sheet to get the client's grand total at the end of the week. Kind of like, if any cell in Row 3 has the word (name) Doe in it, return the value in row 10 of the corresponding column (where the labor for that day has been added up for that client on that day). It'd be great if it could add everything up for that client for the week every time their name is mentioned.
Too much to ask? Thanks for any help!!
If you can standardize the column that the name will occur in you can use vlookup to do exactly what you want. You may need to use partial matches as well if you want only check for part of the name https://exceljet.net/formula/partial-match-with-vlookup.

Resources