Google Sheets - Group Users With >1 Attributes - excel

I'm working with a data of submission results. Some of data points available: name of submitter, date of processing, and results (approve/reject).
Here is a sample dataset:
Data is sorted by (in this order):
Name of submitter
Submission time of each person, in ascending order (e.g. Andy's 2 entries: first row rejected, second row approved.)
My goal : identify people who has been rejected AND tried submitting again AND eventually got approved.
Or an alternative 'filtering' statement = anyone who has BOTH approved AND rejected submissions.
So when applied to the data sample above::
Both Andy and Evan meets the criteria, since they both have been rejected (could be 1x or >1x), but eventually got approved.
People who got approved in their first try (David), or rejected but never got approved (Bill, Chris), would not be included.
Currently I only could achieve that by eyeballing the dataset, just like one might do on a small dataset such as above. However, I work with 10k+ rows in the actual dataset.
I managed to remove people who only have a single entry (regardless of approved status) since people who meet my criteria would have at least 2 entries.
I used highlight duplicate formula to color the duplicates, sorted the data by cell color, then remove the single entries.
When applied to the sample data above, I got:
My question is: is there a formula that could help me separate the Bills (multiple rejects) from Andys and Evans (people with 1 approve and at least 1 rejects) in a large dataset, without having to eyeball them?
Thank you so much for your help.

Thanks to #Solarmike, found a solution:
Use countifs to calculate the number of approve and rejects for each name.
Then filter out the ones with ApproveCount = 0.

Try below formula
=FILTER(UNIQUE(A2:A10),ArrayFormula(COUNTIFS(A2:A,UNIQUE(A2:A10),B2:B,"Reject")*(COUNTIFS(A2:A,UNIQUE(A2:A10),B2:B,"Approve"))>0))

Related

How do I recieve the number of cells based off of three columns in Excel?

I'm not too sure how to word this problem so, I apologize for the vagueness. Here is what I am trying to do though:
I have a large Excel table with a ton of values, I however, only care about 3 columns. The three columns I have are "Project Name", "Active/Planned", and "Week of Month". Here is an example of some values I would have:
Project Name
Active/Planned
Week of Month
StoreProj
Active
2021-07 Jul-Wk1
SecProj
Planned
2021-07 Jul-Wk2
StoreProj
Active
2021-07 Jul-Wk1
Now, I have used a formula to get the number of projects based on a specific week month and avoiding duplicate values for the project name. The code I used returns an integer of the number of projects. Here is what I used:
=IFERROR(ROWS(UNIQUE(FILTER(Table[Project Name],Table[Week of Month]=2021-07 Jul-Wk1))), 0)
This works as intended. Now the issue I am running into is that I need to filter through these rows as I did previously, but now I need to include the "Active/Planned" column. So, I want to be able to see how many projects I have based off of the week of the month and return a number of projects (excluding duplicate names), but be able to filter through that integer output based off of the active/planned projects. So in a perfect scenario I can choose the week of month and if the project is "Active" or "Planned" and see the amount of projects I have.
This might be an easy fix so I apologize, I am just stumped, any help would be greatly appreciated. Thanks!
Work through that step by step, you've got the FILTER function which is giving data to the UNIQUE function, to the ROWS function, and then your IFERROR. However, the data about whether each line/row is 'Active' or 'planned' isn't passed out beyond the FILTER function, so can't be used by anything further on in the above sequence.
Boring theoretical advice out the way, try this;
=COUNT(IF(UNIQUE(FILTER( Table[[Project Name]:[Active/Planned]], Table[Week of Month] = "2021-07 Jul-wk1"))= "Active", 1))
Explanation:
FILTER(...) outputs records with the relevant date filter, however it outputs Table[[Project Name]:[Active/Planned]] - both columns, to ensure all relevant data is there.
UNIQUE(...) Then narrows that down to unique values, although by this stage I'm not 100% sure you need this.
IF(... = "Active", 1) then replaces the 'Active' outputs with 1s
COUNT() returns the number of cells in the above that contain a number (the 1s from the IF())
Yes, you can't use COUNTIF on arrays (and all except that last bullet point above are outputting arrays not single values) - and no, I didn't know that before attempting to answer this question, found it over at a different question!

Define Status depending on Criteria

I have advanced Excel/Google Sheets skills. I have more of a conceptual question. I am happy with any solution (Excel or for Sheets, no difference for me).
I have a sheet where various coworkers have access and work with. It is used to define which product needs to go through which steps. Then when a part of a job is done, the status of the product is changed depending on criteria.
You can also think of it as projects and the status of a project.
The 3 examples shows how the data is input by the workers. Sometimes, the "No" cells are empty, sometimes they have a "No", sometimes for the same product, one criterion is empty, the other has a "No".
If I do a nested IF formula, I would have to create 32 of them (I believe, since its 5 criteria with each 2 options).
Obviously I can do that. I was wondering anyone has a better solution for me? Something more practical.
Thanks in advance!
Based on the data you've provided, it looks like your statuses are based on the number of Yes's in the input columns. Also you don't have a status shown for zero Yes's so I'll make an additional for that.
Given that assumption you can use a combination of the COUNTIF function (to count the Yes's), and the IFS function (to manage nested Ifs better) to drastically reduce the size of your function.
To make this cleaner I suggest you add a column and hide it containing: =COUNTIF([InputCriteria1to5Range],"Yes")
For the next formula assume the formula above is in B2. In your status column put the following:
=IFS(B2=5, Status1, B2=4, Status2, B2=3, Status3, B2=2, Status4, B2=1, Status5, B2=0, Status6)
Solution: Thanks to all for your help, I ended up firstly, creating ALL scenarios. This was actually the most complex part. See https://www.mrexcel.com/forum/excel-questions/654871-how-generate-all-possible-combinations-two-lists-without-macro.html (Answer from "Tusharm") where I had to repeat this process 5 times to have all possible outcomes. In the end, there were 192 combinations.
Then, I assigned a status for each combination.
Finally, for each product/row, I created another column where I concatenated the different criteria so that it looks exactly like my above combinations. Then finally index match the concatenated criteria to my combinations.

Advanced lookup formulas based on a combination of unique rules

I am creating an attendance tracking form for work and require someone with more advanced knowledge of excel. This is to track employee tardy's and unplanned absences (UPT). When employees get too many tardy's or UPT's it is called an "Occurrence", when the number of occurrences increase it will increase the "Action Level". I input new data every 2 weeks and then send out emails to notify employees and their managers of increased action levels due to these attendance issues, I want this spreadsheet to do some of the work for me since I am working with hundreds of employees and so the process can sometimes take multiple days to complete.
My objective is to populate the Employee overview cells with the correct details from the Attendance Details page. The challenging part is that there are three rules that dictate which dates I need to populate the Employee Overview with.
Rule 1: Four tardies (TAR) makes an occurrence.
Rule 2: One UPT makes an occurrence, but if there can be multiple UPT's that only make one occurrence as long as they are within 5 days of each other.
Rule 3: Tardies and UPT's disappear after 365 days.
The increase of occurrences will increase the action level (See table in Employee Overview Screenshot).
In my example screenshots, the details should produce the hardcoded Employee overview I made for Bob Smith. I am not expecting anyone to have all the answers, but please help me by suggesting tips or tools available for accomplishing what I require. Please ask any clarifying questions if you wish to help but don't understand what I am requiring.
Screenshot of Attendance Details
Screenshot of Employee Overview for Bob Smith (Hardcoded)
I propose :
break the task/evaluation
Each rule may generate a set of new cell/data/table. thus, work with 1 rule first.
Repeat for another rule.
Consolidate.
these are just my head thinking out loud... hope it helps in anyways.. (care to comment? :)
Rule 1 : =if(countif(<TarRange>,"TAR")>=4,1,0) OR =countif(<TarRange>,"TAR")/4
Rule 2 : make a new list of "UPT"& its date, work from there. arranged the data by date, and use =if((day(<NextEntryDate>-day(<previousEntryDate>))<=5,<currentEntrydate>,"")
Rule 3 : every date cell values can be extracted using year(),month() and day(). Also look in to days calculation in excel help. I see that you'll need an extra column (beside the Rule 2 list) to do a moving summation. An example of moving summation is in the column H & I inside this post :
it uses if(<Day1>=<Day2>,<Count>,<DontCount>) Syntax. it can be change to year1/year2 in your case.
IMHO. Do share with us if you are stuck/successful. (:

Understanding a lookup formula used to calculate balances based on transactions

Below I was given the following formula to lookup the last transaction in an account (there is a total of 4 accounts) and calculate its current balance based on the transaction of the current row (in this case row 1075). $E$2:$E1074 is the range for the varrying accounts. $F$2:$F1074 is the range of balances associated with each of those accounts. $C1075 is the current transaction we are looking at on row 1075. The error is included in the case that the account in column E does no match an other account in column E and therefore is a new account and the first transaction for that account. This code works.
=IFERROR(LOOKUP(2,1/($E$2:$E1074=$E1075),$F$2:$F1074)-$C1075,-$C1075)
I have experience with vlookup and hlookup but I don't understand the first two sections of this lookup function. specifically the 2 and the 1/($E$2:$E1074=$E1075). I'm not sure what these two values calculate and output to give the desired result. Thank you in advance for your help
Why 2 is for much the same reason as why a "big number" or "big text" (say zzz) can be useful in a MATCH function (that I tried to explain here). Here any number larger than 1 would serve since the objective is to look for what does not exist in order to make the search continue through to the last entry. Returning that last entry, rather than an error for "Not found" may not have been intended - but can be very useful.

Grouping rows by area codes

I have a table of customers to which my company ships products. The problem is that these customers need to be sorted by their area codes, so that the products can be sent to the appropriate shipping companies (we have two partner companies that ship to certain parts of the country). Each company sent us a list of area code numbers to which they can ship and I need to divide the Excel sheet into two sheets, each containing the customers with the area codes compatible with the respective company.
I tried to solve this problem with VLOOKUP function, but it only works on individual row basis, and I need a solution that will find all rows that contain a number from the specified group of area codes.
Another way would be IF function that would put a True or False (one IF function for each company) value in new column and then I could sort by that value, and copy the data into a new sheet. This approach would work, but the IF function would be extremely long and hard to control.
Can you suggest a way to solve this problem?
Edit to incorporate details provided via Comment:
Presently I have about 5,000 rows but in future it might be more though I doubt over 10,000 rows.
A VLOOKUP seems very promising, of the kind =VLOOKUP($B2,F:G,1,0) in C2 copied across and down as required, with a layout as below:
This does not group as you say you require (but do you really need to?) because it seems possible some locations will be served by both shippers. You might resolve this by flagging those rows where both are viable and then by sorting to split into three groups (Shipper1 only, Shipper2 only, both) before transferring the ranges as desired.
Edit in response to OPs comment
If you can be certain there is no overlap between Shippers, a single column with this formula, say in E2copied down, might be preferable:
=IF(ISERROR(MATCH(B2,F:F,0)>0),"Shipper2","Shipper1")
and would not routinely show #N/A. (This assumes no area is outside the range of both shippers.)

Resources