Soccer Results: Count wins when 4 or more goals scored by speciied team - excel

I have the following in excel:
A B C D E
1 Arsenal 3 v 2 Liverpool
2 Arsenal 4 v 1 Chelsea
3 Liverpool 1 v 1 Spurs
4 Arsenal 3 v 0 Stoke
5 Arsenal 6 v 2 Huddersfield
What I would like to do is count how many occasions Arsenal won then game when they scored 4 or more goals. In the example above I would need to return "2" as they beat Chelsea 4-1 and Huddersfield 6-2.
I have tried countifs, sumifs, sumproducts but I am going round in circles.
Any help would be appreciated. Many thanks, Alan.

If Arsenal can only be in column A then you can use this formula
=SUMPRODUCT((A1:A5="Arsenal")*(B1:B5>D1:D5)*(B1:B5>=4))
....or if Arsenal could also appear in column E (as away team?) then you can use this version
=SUMPRODUCT((A1:A5="Arsenal")*(B1:B5>D1:D5)*(B1:B5>=4)+(E1:E5="Arsenal")*(D1:D5>B1:B5)*(D1:D5>=4))

Countifs() is the formula you need. These are the conditions:
COLUMN A = ARSENAL
COLUMN B > COLUMN D
COLUMN B > 3
Read the documentation here and give it a try once again.

Related

Group by name and count unique values

I have an Excel file like this, where column A and B are given. I want to add column C and D that represent days. D is pretty easy, because it is always one day. C is tricky, because I want to count only "unique" days, where a branch can be one day maximum, where D counts all days.
A B C D
Row Name Branch Unique Overall
1 Jack Health 1 1
2 Jack Health 0 1
3 Jack Food 1 1
4 Jolie Tech 1 1
5 Jolie Food 1 1
6 Jolie Tech 0 1
7 Jolie Health 1 1
I need column C and D for a pivot table like this:
Branch Unique Overall
Health 2 3
Food 2 2
Tech 1 2
I also could add names as a sub position.
Branch Unique Overall
Health 2 3
-Jack 1 2
-Jolie 1 1
Food 2 2
-Jack 1 1
-Jolie 1 1
Tech 1 2
-Jolie 1 2
But that´s something, that can be done after preparing the data and what comes with the program anyway. So how can I design a formula that counts only unique branches for a data set of hundreds of rows?
Thank you!
In C2 put:
=--(COUNTIFS($A$2:A2,A2,$B$2:B2,B2)=1)
Then copy down

Finding MAX value using VLOOKUP with many duplicate "IDs"

Using an Excel formula, I'm trying to pull the MAX value for a NAME that has a certain LETTER next to it.
Eg: Highest # for a specific % for each unique Name
So Jeff's Q value would be 7.
(I'm trying to over explain because it makes sense in my mind but it might not make sense to others..)
Name % #
Jeff O 4
Jeff D 3
Jeff Q 4
Jeff O 1
Jeff D 9
Jeff Q 7
Tom O 6
Tom D 7
Tom Q 8
Tom O 2
Tom D 8
Tom Q 3
Peter O 3
Peter D 8
Peter Q 7
Peter O 4
Peter D 10
Peter Q 3
Bob O 2
Bob D 6
Bob Q 10
Bob O 6
Bob D 10
Bob Q 9
Mark O 4
Mark D 7
Mark Q 4
Mark O 7
Mark D 8
Mark Q 1
I can't think of a way to run this without having dedicated worksheets for each person and running MAX on the specific column.
I've tried IF, VLOOKUP and MAX in various configurations but I get nothing.
Has anyone got any experience with this and could please point me in the right direction?
The MAXIFS function should be what you want. For example, assuming that you have your data in columns A:C the formula
=MAXIFS(C:C,A:A,"Jeff",B:B,"Q")
will give you the max number in column C where the value in row A is "Jeff" and the value in row B is "Q".

Get Top Performer by Subgroup Using Index and Match

I am trying to rank names in Column C from largest to smallest score.
Category Score Name Total Rank Apple Rank Orange Rank
Apple 10 Joe Rachel Rachel 0
Orange 15 Don Natalie 0 Natalie
Apple 20 James Tom Tom 0
Apple 1 Rob Nothing Nothing 0
Orange 3 Mary Gina 0 Gina
Orange 100 Rachel James 0 James
Orange 99 Natalie Don 0 Don
Orange 87 Tom Joe 0 Joe
Apple 27 Gina Mary Mary 0
Orange 30 Nothing Rob 0 Rob
This works in Column E for Apples AND Oranges, with formula in E2 that is
=INDEX($C$2:$C$25,MATCH(1,INDEX(($B$2:$B$25=LARGE($B$2:$B$25,ROWS(E$1:E1)))*(COUNTIF(E$1:E1,$C$2:$C$25)=0),),0))
However, the goal is to compare Apples to Apples and Oranges to Oranges.
Only, the formulas in Columns F and G show "0" values for those rows that aren't in the right Apple/Orange category.
For F2:
=IF($A:$A="Apple",INDEX($C:$C,MATCH(1,INDEX(($B:$B=LARGE($B:$B,ROWS(F$1:F1)))*(COUNTIF(F$1:F1,$C:$C)=0),),0)),0)
For G2:
=IF($A:$A="Orange",INDEX($C:$C,MATCH(1,INDEX(($B:$B=LARGE($B:$B,ROWS(G$1:G1)))*(COUNTIF(G$1:G1,$C:$C)=0),),0)),0)
How do I modify the codes so that 0 values won't show up?
Something like this would be great: (screenshot made by just copy pasting values...)
Apple Rank Orange Rank
Rachel Natalie
Tom Gina
Nothing James
Mary Don
Joe
Rob
Note: Unless the whole column ranges are required the steps below may seem to take an uncomfortably long time if these ranges are not restricted.
Assuming you have what below is in ColumnA:G and a corresponding layout:
then ColumnsI:J may be achieved quite simply by copying ColumnF:G and Paste Special..., Values into I1, then select ColumnsI:J, HOME > Editing - Find & Select, Replace..., Find what: 0, Replace with: , Replace All followed by Find & Select, Go To Special..., select Blanks (only), OK, right-click on one of the chosen cells and Delete..., Shift cells up, OK.
To remove the 0s from ColumnF:G only replacing the final 0 in each formula with "" is sufficient.

count data using two columns as references

Is it possible to count or countif by using a column as the data, a cell for the criteria (or what to match) and range of what to count?
Here is what I am looking at:
A1 B C D E F G H I J K L M N O
2 Running Data Total Count of Tardies (by category)
3 Date Employees Leader Start of Shift Break 1 Lunch Break 2 Employees Start of Shift Break 1 Lunch Break 2 Total
4 1-Jul Abe Sue 15 Abe 0
5 3-Jul Steve Bob 20 Anna 0
6 5-Jul Eve Andy 9 20 Eve 0
7 7-Jul Anna Andy 30 Helen 0
8 15-Jul Abe Sue 15 Mark 0
9 18-Jul Anna Andy 10 Steve 0
10 20-Jul Helen Sue 9 0
11 31-Jul Mark Bob 45 0
I am trying to count the data entered on the left (running data) in each category and having it show based on the Employees on the right (in the orange cells). So Abe should show 1 for Start of Shift, Eve should show 1 for Break 1 and Break 2, and Anna should show 2 for Start of Shift.
I have tried using:
=countif(C:C,$J4,D:D) to get the data from JUST Column D for Start of shift, but it gives and error saying too many arguments for the function have been entered.
Help...
...and Thanks!
Countif will only look at 1 column to decide what to count.
Countifs will look at multiple columns. Your formula would look something like this:
=COUNTIFS($C:$C,$J4,E:E,">0")

How to do COUNTIFS in horizontal and vertical data with unequal number of rows?

How can I count the number of occurrences of numbers 3, 4, 5, etc. of data that meets the criteria in both horizontal and vertical positions using Excel functions?
A B C D
Trainer Q1 Q2 Q3
Terry Wong 5 4 4
Terry Wong 4 4 4
Terry Wong 4 4 2
Terry Wong 3 3 2
Maggie Ngeow Nyuk Chin 3 4 4
Maggie Ngeow Nyuk Chin 4 4 4
Maggie Ngeow Nyuk Chin 4 4 4
I have tried
=COUNTIFS(A1:A8,"=Terry Wong",B:D,"=4")
But there is an error in it because Excel needs both range criteria to have an equal number of rows.
Can you suggest a workaround for this?
Just in case it's useful to anyone, here's a formula that will return the total number of 4's for Terry Wong:
=SUMPRODUCT(--(A2:A8="Terry Wong"),(B2:B8=4)+(C2:C8=4)+(D2:D8=4))
Do you mean you want to do this:
=COUNTIFS(A2:A8,"Terry Wong",C1:C7,4,D1:D7,4,E1:E7,4)

Resources