Excel repeat cells - excel

I need and approach for this:
A B C
1 house 1 house
2 car 1 car
3 boy 1 boy
4 2 house
5 2 car
2 boy
3 house
3 car
3 boy
…
I want to make a function that when I drag it down I get this result.

In C1 enter:
=ROUNDUP(ROW()/3,0) & " " & INDEX(B:B,IF(MOD(ROW(),3)=0,3,MOD(ROW(),3)))
and copy down

Please try:
=INDIRECT("A"&FLOOR(1+(ROW()-1)/3,1))&" "&INDIRECT("B"&MOD(ROW()-1,3)+1)

Related

How do I create single cell arrays based on unique contiguous groups?

Column A identifies unique families using multiple other columns of data.
Column B is a list of individuals.
I would like Column C to contain cell arrays of these families (Shown Below).
For some reason, the MATCH formula in my attempted solution is returning the last occurrence of the match, so it does not work.
I have tried this formula (the output of this is shown in Column D in the picture):
{=OFFSET(INDEX(A:A, MATCH(A1,A:A)),0,1,COUNTIF(A:A,A1))}
A B C D
1 Tom 1 {Tom One, Sue One} Sue 1
1 Sue 1 {Tom One, Sue One} Sue 1
2 Bob 2 {Bob Two, Joan Two, John Two} John 2
2 Joan 2 {Bob Two, Joan Two, John Two} John 2
2 John 2 {Bob Two, Joan Two, John Two} John 2
3 Tom 3 {Tom Three} Tom 3
4 Joe 4 {Joe Four} Joe 4
You can use the following formula, the condition is that it is sorted baed on column A:
="{"&TEXTJOIN(",",TRUE,INDEX(B:B,MATCH(A1,A:A,0)):INDEX(B:B,MATCH(A1,A:A,1)))&"}"

counting unique row values in excel

I have product list like this. I have only product name list
Apple 1
Apple 1
Apple 1
Orange 2
Orange 2
Orange 2
Mango 3
Mango 3
Pineapple 4
Pineapple 4
Pineapple 4
Pineapple 4
Pineapple 4
Pineapple 4
Avocado 5
I want to count data in this way. please help.
In B1 insert 1 and in B2 insert:
=IF(A2=A1,B1,B1+1)
And from there just fill.
Put 1 in B1 then put this formula in B2,
=if(a2<>a1, max(b$1:b1)+1, b1)
... and fill down.
Alternately just put his formula into B1,
=SUMPRODUCT(1/(COUNTIF(A$1:A1,A$1:A1)))
... and fill down.

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

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.

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")

Resources