Excel formula find duplicates with multiple criteria - excel-formula

I am trying to create an excel formula that locates duplicate entries for an employee. Records are pulled from two different systems and then the data is dumped into excel. Below is an example of how the records look. If an employee performed the same task on the same day that is a duplicate.
I've tried the index/match, index/match match, but it will only return the first duplicate (if it even works to do that). I have very little experience with arrays and I've been trying to figure those out to no avail - I feel like this should be easier than I'm making it??
Ideally would want it to return "yes/no" or "duplicate" when a duplicate value is found.
Set One
Client Employee Date
Bob Jones Sally Smith 1/1/2018
Jane Smith Tom Jones 2/1/2018
Set Two
Client Date Employee Task
Bob Jones 1/1/2018 Sally Smith 1
Bob Jones 1/1/2018 Sally Smith 2
Jane Smith 2/1/2018 Tom Jones 1
Jane Smith 2/1/2018 Tom Jones 1

I'm going to show an example using formula based conditional formatting. First you need to select more rules in conditional formatting as shown in the picture below.
After that you pick the option to use the formula to determine which cells to format, and use a formula that looks like this, it's a basic COUNTIFS formula that checks whether the records match at least one other record in the table in all columns that you write down.
=COUNTIFS($A$1:$A$10;$A1;$B$1:$B$10;$B1;$C$1:$C$10;$C1)>1
Note that the default format that the Excel offers you is actually a basic format, so you need to make sure to change it so you know whether the formula is working or not.

I might still be misunderstanding what you're trying to do, but if you want the first table to have a count of how many rows in second table have matching Client&Employee&Date to the first table, you could use COUNTIF (or perhaps VLOOKUP), with the aid of a "helper column" in the second table.
The helper column would concatenate Client&Employee&Date from the second row.
Forgive the weird image example... my beta version of Excel 2019 keeps crashing today and I'm not 100% sure this is what you're trying to do. (If it is what you need to do but don't understand the image, comment # me and I will explain further.)

Related

Need help optimizing vacation planning Excel (sumproduct of 10000+ rows)

In this picture you can see in column F to H what the raw data looks like and column A to D is what I need (but horizontal).
I transformed the data to show exact dates when employee is on vacation and not date ranges for example:
John 02.01.2018 03.01.2018 04.01.2018 05.01.2018
John 07.01.2018 08.01.2018 09.01.2018 10.01.2018
Tom 01.01.2018 02.01.2018 03.01.2018 04.01.2018 05.01.2018
Tom 07.01.2018 08.01.2018 09.01.2018
Mark 04.01.2018 05.01.2018 06.01.2018
Mark 08.01.2018 09.01.2018 10.01.2018
This way I can use sumproduct to fill my planning table and it works.I managed to do it for managers because the raw data is only 400 rows I use this formula:
=IF(SUMPRODUCT((OFFSET(VMX!$G$2;0;0;COUNTIF(VMX!$G:$G;">""")-1;1)=Planner!$A3)*(INDIRECT("VMX!$O$2:$AS$"&COUNTIF(VMX!$G:$G;">"""))=Planner!G$1)*(OFFSET(VMX!$M$2;0;0;COUNTIF(VMX!$M:$M;">""")-1;1)="X"))>0;"X";IF(SUMPRODUCT((OFFSET(VMX!$G$2;0;0;COUNTIF(VMX!$G:$G;">""")-1;1)=Planner!$A3)*(INDIRECT("VMX!$O$2:$AS$"&COUNTIF(VMX!$G:$G;">"""))=Planner!G$1)*(OFFSET(VMX!$M$2;0;0;COUNTIF(VMX!$M:$M;">""")-1;1)="Y"))>0;"Y";IF(SUMPRODUCT((OFFSET(VMX!$G$2;0;0;COUNTIF(VMX!$G:$G;">""")-1;1)=Planner!$A3)*(INDIRECT("VMX!$O$2:$AS$"&COUNTIF(VMX!$G:$G;">"""))=Planner!G$1)*(OFFSET(VMX!$M$2;0;0;COUNTIF(VMX!$M:$M;">""")-1;1)="O"))>0;"O";"")))
I simplified this formula using name manager to this:
=IF(SPX>0;"X";IF(SPY>0;"Y";IF(SPO>0;"O";"")))
In sheet VMX is the data.
The data ranges should be dynamic because I used offset and indirect but when I try to use this for all employees which is 10k+ rows the excel just freezes.
Does anyone know more efficient way to do this?
First convert your raw data to a table (tblVacDates). Then you can use a formula like this, using COUNTIFS.
=IF(COUNTIFS(tblVacDates[Name];B$1,tblVacDates[Start];"<="&$A2;tblVacDates[End];">="&$A2)=0;"";"X")
Paste the formula to the other columns (don't drag). Then you can copy/drag down

EXCEL - Match values from one sheet to another and then paste results

I'm trying to make the most user-friendly excel spreadsheet I can. This spreadsheet takes a name that the user puts in for a client, sometimes a first name and sometimes first and last. I have another sheet with the full list of clients, first and last names.
What I need to do is look at the user input, match that name to the client list sheet, and then paste that into the original sheet.
Example:
USER SHEET
A
1 Jane
2 Helen Smith
3 John
CLIENT LIST SHEET
A B
1 Johnson Jane
2 Smith Helen
3 Brown John
I need the User Sheet to look like
A B
1 Jane Johnson, Jane
2 Helen Smith Smith, Helen
3 John Brown, John
I know this might be a complicated formula, I've tried to write a whole bunch of different ones but none of them are really doing what I need them to.
Most of the problem is that I need other people I work with, who don't know how to use excel and sometimes aren't able to write the full names, to be able to use this spreadsheet once I have a generic formula in there, and all that would need to be changed is the Client List sheet.
Hopefully I provided enough detail in here. Thanks for any help you give me in advance, super appreciate it. If I find a solve I'll post it.
I have an idea. In your Client sheet, in the third column build a formula that combines first & last name, like:
=B1&" "&C1
Then select the range of names (columns A:C) and Insert Table (without headers). You can enter the header labels later:
From the Formulas Ribbon, open the Name Manager. Define a new name called "ClientNames" and have it refer to the fullname column (modify the Refers To formula based on your table's name & column header name):
Then, on your User Sheet, select column A, and from Data ribbon Data Validation. Allow "List" and set the "Source" formula to =ClientNames.
Finally, instruct your users to choose a client name from the validation list. This will prevent them from making bad inputs and also enforce a standard against the "Users" worksheet.
If you still need the formatted LastName,FirstName in column B, then do a formula:
=RIGHT(A1,LEN(A1)-FIND(" ",A1))&", "&LEFT(A1,FIND(" ",A1)-1)
This formula might be looking too complex but it is simple,
use this in column B of your user sheet and drag across the rows.
=IFERROR(INDEX(Sheet2!A:B,MATCH(LEFT(A1,LEN(A1)-FIND(" ",A1)),Sheet2!B:B,0),1)&", "&INDEX(Sheet2!A:B,MATCH(LEFT(A1,LEN(A1)-FIND(" ",A1)),Sheet2!B:B,0),2),IFERROR(INDEX(Sheet2!A:B,MATCH(LEFT(A1,LEN(A1)-FIND(" ",A1)),Sheet2!A:A,0),1)&", "&INDEX(Sheet2!A:B,MATCH(LEFT(A1,LEN(A1)-FIND(" ",A1)),Sheet2!A:A,0),2),IFERROR(INDEX(Sheet2!A:B,MATCH(A1,Sheet2!B:B,0),1)&", "&INDEX(Sheet2!A:B,MATCH(A1,Sheet2!B:B,0),2),IFERROR(INDEX(Sheet2!A:B,MATCH(A1,Sheet2!A:A,0),1)&", "&INDEX(Sheet2!A:B,MATCH(A1,Sheet2!A:A,0),2),""))))
This formula is for A1, you can modify it if you want to start from searching A2. Let me know if you need help. This might look big but its very useful for dragging across ranges.

Two week notice excel

I am managing project due dates for respective students and I need the last column, “target date” to show a two week due date notification. The notification just means the row's "target date" turns red as soon as there is a two week period before the stated date.
Here is what it looks like:
A B C
John Doe 1/17/2016 4/1/16 (needs to turn red)
Bob JoeBob 7/1/2016 7/28/16 (needs to turn red)
Corny Steve 7/1/2016 7/30/16 (still normal font)
Any help would be greatly appreciated!
Highlight cells you want it to apply to, create a new rule in the conditional formatting drop-down menu, then write the formula =TODAY()+14

is there a formula (or something) that i can use to get information from the same row that a formula gets its answer from

I have 2 work sheets. One where the raw data is entered and one that is a summary page.
It tracks scores in 4 sporting events with the student name and school name.
I have the rank of their score so I can get 1st, 2nd, 3rd etc even with ties and no skipping over the rank number if there is a tie so you see 1,2,2,3,4.... I have the top 7 scores go to the summary page for each event. What I need to do is take the name of the student and the school, and bring it with their score to the summary page. I have limited skill in excel 2010 (that is what I am using. No skill what so ever in VBA or sql or any of that type of coding. I am hoping there is a formula that will allow me to get the school and name of the student from the area where the score came from. I hope I'm not too confusing with this.
Raw data page would look something like this where we enter the names of the schools competing, the name of the student and the scores they get.
The ABC School
mary Smith 8.50
Jane white 7.60
The Awesome School
Jane Doe 9.52
Betty May 8.50
The summary page would be the rank in the first column, the school in the 2nd column, the student name in the 3rd column and the score in the 5th column. It's the School and Student Name I can't get into the columns:
Rank School Student name Score**
1 The Awesome School Jane Doe 9.52
2 The Awesome School Betty May 8.50
2 The ABC School Mary Smith 8.50
3 The ABC School Jane White 7.60
I have also used "names" for ranges of formulas so a big range for event #1 might be called "Event1" so it was easier to do my other formulas.
I need the formulas you may come up with explained a bit as I am no expert when it comes to formulas and can get confused when it gets long.
From the second table in you post, you can build a pivot table.
Your data looks like this:
Click anywhere within that table and then click Insert > Pivot table. Select to show the pivot table on a new sheet or in the existing sheet.
In the Pivot Table panel that appears on the right of the window,
select and drag School to the rows panel
then drag Student name to the rows panel
then drag Score to the values panel
The pivot table will then look like this:
This is the result you asked for in your question. You can fine-tune the display and data in the pivot table. There are hundreds of articles and tutorials about Pivot Tables on the Internet.

Excel extract and average values from column

Is it possible if I have one column with names and another with pay. i.e.
John $120
John $100
Sally $90
Sally $100
Sally $80
to extract the values from column 2 for both John and Sally and then average them and place the results into two cells in another column? Could I use spreadsheet commands or do I need VBA to do this automatically.
You could use either
AVERAGEIFS (for xl07 and onwards)
A PivotTable see Debra's site for a good reference
If your data was in A2:B6 then this formula in D1 (with "John" in C1) works
=AVERAGEIFS($B$2:$B$6,$A$2:$A$6,D1)
If you need your spreadsheet to work with excel versions earlier than 2007, you can also use this formula:
=SUM(($D$1=$A$2:$A$6)*($B$2:$B$6)) / COUNTIF($A$2,$D$1)
This is an array formula, so you'll need to press CTRL+SHIFT+ENTER instead of just ENTER when entering it.
The formula works with the sample table in brettdj's answer, where
List of names is in A2:A6
List of values is in B2:B6
"John" is in D1
This formula goes into E1 (or anywhere, actually).
It works by calculating the sum of values in B2:B6 where the corresponding A2:A6 value is John, and then dividing it by the total number of Johns in A2:A6, which returns the average.
It works perfectly if you use semicolon (;) instead of comma (,) as it is below:
=AVERAGEIFS($B$2:$B$6,$A$2:$A$6,D1) - it doesn't work,
=AVERAGEIFS($B$2:$B$6;$A$2:$A$6;D1) - it works!

Resources