I have some data formatted like this
A B C
Phone Name Zip
1 111-222-3333 Steve Harvey 12345
2 111-222-3333 Steve Harvey 12354
3 222-333-4444 Barry Badgernaff 65423
4 222-333-4444 Barry Badgernaff 65432
5 333-444-5555 Jim Bob 36521
6 444-555-6666 Mickey Mouse 36541
7 666-777-8888 Donald Duck 39847
8 666-777-8888 Donald Duck 39874
What I'm looking to do is identify consecutive duplicate names. If there are duplicates, I want them ignored so I can filter them out
For example
A B C D
Phone Name Zip Result
1 111-222-3333 Steve Harvey 12345 Duplicate
2 111-222-3333 Steve Harvey 12354 Duplicate
3 222-333-4444 Barry Badgernaff 65423 Duplicate
4 222-333-4444 Barry Badgernaff 65432 Duplicate
5 333-444-5555 Jim Bob 36521 Not A Duplicate
6 444-555-6666 Mickey Mouse 36541 Not A Duplicate
7 666-777-8888 Donald Duck 39847 Duplicate
8 666-777-8888 Donald Duck 39874 Duplicate
What I've done is tried identifying these using =IF(B2=B1, "True", "False) but it slightly only does what I'm looking for and I end up getting false positives
What else can I try? I don't want to remove the data, just have a cell say if there are consecutive names in the data.
Your formula only checks the next row, but you should check the previous one as well.
Try this in B2 : =IF(OR(B2=B1, B2=B3), "True", "False")
Related
I'm trying to compile a best 5 and worst 5 list. I have two rows, column B with the number score and column C with the name. I only want the list to include the name.
In my previous attempts the formula would get the top/bottom 5 but as soon as a duplicate score appeared the first known name with that value would just repeat.
Here is my data
26 Cal
55 John
55 Mike
100 Steve
26 Thomas
100 Jaden
100 Jack
95 Josh
87 Cole
75 Brett
I've managed to get the bottom 5 list formula correct. This formula works perfectly and includes all names of duplicate scores.
Example of what I get:
Cal
Thomas
John
Mike
Brett
=INDEX($C$56:$E$70,SMALL(IF($B$56:$B$70=SMALL($B$56:$B$70,ROWS(E$2:E2)),ROW($B$56:$B$70)-ROW($B$56)+1),SUM(IF($B$56:$B$70=SMALL($B$56:$B$70,
ROWS(E$2:E2)),1,0))-SUM(IF($B$56:$B$70<=SMALL($B$56:$B$70,ROWS(E$2:E2)),1,0))+ROWS(E$2:E2)))
Here is the formula I've tried to get the top 5 - however I keep getting an error.
=INDEX($C$56:$E$70,LARGE(IF($B$56:$B$70=LARGE($B$56:$B$70,ROWS(E$2:E2)),ROW($B$56:$B$70)-ROW($B$56)+1),SUM(IF($B$56:$B$70=LARGE($B$56:$B$70,
ROWS(E$2:E2)),1,0))-SUM(IF($B$56:$B$70<=LARGE($B$56:$B$70,ROWS(E$2:E2)),1,0))+ROWS(E$2:E2)))
Example of what I'm looking for
Steve
Jaden
Jack
Josh
Cole
You can set two queries like this for both cases:
=QUERY(B56:C70,"Select C order by B desc limit 5")
=QUERY(B56:C70,"Select C order by B limit 5")
Use SORTN() function like-
=SORTN(A1:B10,5,,1,1)
To keep only one column, wrap the SORTN() function with INDEX() and specify column number. Try-
=INDEX(SORTN(A1:B10,5,,1,1),,2)
enter image description hereI have an array of people with scores in other column. I need to find top 3 people with highest score and print their names.
Example:
Maria 1
Thomas 4
John 3
Jack 2
Ray 2
Laura 4
Kate 3
Result should be:
Thomas
Laura
John
What I get:
Thomas
Thomas
John
What I get:
Thomas
John
num
I have tried using LARGE, MATCH, MIN, MAX but nothings works.
My first failure code:
=INDEX($A$2:$A$8; MATCH(LARGE(($B$2:$B$8);{1;2;3}); $B$2:$B$8;0))
My second failure code:
{=INDEX($A$2:$A$14;SMALL(IF($B$2:$B$14=MAX($B$2:$B$14);ROW($B$2:$B$14)-1);ROW(B4)-1))}
Put this in the second row of the column you want:
=INDEX(A:A,AGGREGATE(15,7,ROW($B$1:$B$7)/((COUNTIF($D$1:D1,$A$1:$A$7)=0)*($B$1:$B$7=LARGE(B:B,ROW(1:1)))),1))
And drag down three rows:
Let's say I've got two tables with two columns. In both cases, the first column consists of a name and a second column consist string of characters with the similar pattern. It looks like this:
Table 1
Peter xxxxx01
John xxxxx01
Bill xxxxx01
William xxxxx01
Table 2
Richard xxxxx02
John xxxxx02
Bill xxxxx02
Arthur xxxxx02
Now, I'd like to compare these two tables, find values where the names are duplicated and display data stored in second columns, just like this:
(Peter excluded)
John xxxxx01 xxxxx02
Bill xxxxx01 xxxxx02
(William, Arthur excluded)
I am familiar with pivot tables, however, it won't allow doing this.
I've also tried messing with index match formulas but without much success.
Any advices?
You can use the VLOOKUP function for this.
If your "Table1" is in B3:C6, and your "Table 2" is in F3:G6, then you can use the following formula in D3:D6 to lookup the values in table 2;
Cell D3: =IFERROR(VLOOKUP(B3,$F$3:$G$6,2,FALSE),"")
This is first looking up the name in table 1 (Cell B3) against table 2 (F3:G6), and returning the second column of table 2 if it finds the name. If it doesn't find the name, it will return an error, so we wrap the VLOOKUP in an "IFERROR" function, and replace any errors with an empty string, so it looks a bit friendlier. This results in the following table;
A B C D E F G
1
2 Table 1 Result Table 2
3 Peter xxxxxx01 Richard xxxxxx02
4 John xxxxxx01 xxxxxx02 John xxxxxx02
5 Bill xxxxxx01 xxxxxx02 Bill xxxxxx02
6 William xxxxxx01 Arthur xxxxxx02
You can then filter on the (Non-Blanks) in column D to only get the results you're interested in.
Is there a way to make this
---A---
John
John
Tim
steve
John
-------
into this:
-----A--------B------
John 1
John 1
Tim 2
Steve 3
John 1
---------------------
Have a large data file with duplicate names, and would like to number them in the way mentioned in order to use them in another way.
Please try:
=IF(COUNTIF(A$1:A2,A2)=1,MAX(B$1:B1)+1,VLOOKUP(A2,A$1:B1,2,0))
in B2 copied down, with labels or blanks in Row1.
Tried doing this a few ways and I think I'm just looking at this a little too complicated.
I have column a with several different names that repeat. I have column B with dollar amounts. I'm trying to get a formula that will add the totals amount for a specific person.
JOHN $17.23
JAMES $37.52
JOHN $14.23
JAMES $27.52
APRIL $32.00
APRIL $143.20
JOHN $90.27
JOHN $81.13
JOHN = Total for John
JAMES = Total for James
APRIL = Total for April
Thank you
Assuming this table
A B
1 Names Bill
2 John 10
3 Tom 20
4 John 4
5 Tom 3
To get the total for each name you can write
A B
7 Names Total
8 John =Sumif(A2:A5;A8;B2:B5)
9 Tom =Sumif(A2:A5;A9;B2:B5)
This will sum up each value for the given area.
Consider:
=SUMPRODUCT((A$1:A$8="John")*(B$1:B$8))
=SUMPRODUCT((A$1:A$8="James")*(B$1:B$8))
=SUMPRODUCT((A$1:A$8="April")*(B$1:B$8))
Striking my original response in favor of:
=SUMIF(B3:B10,"=JOHN",C3:C10) I tested that, and it works even better