I need to get the top 6 repeating numbers in columns A-F , in any order would be fine , tried using =Mode but I'm stuck
You can use =TRANSPOSE and =MODE.MULT
This is an array formula, close with CTRL+SHIFT+ENTER:
=TRANSPOSE(MODE.MULT(A:F))
And fill across 6 cells to get the top 6 repeating values.
The MODE function is not the most efficient formula, likely due to some internal cyclic calculation. Cut your full column ranges down to the minimum of what is required for an accuate result.
In K12 as a standard formula,
=mode(a:f)
'better as,
=mode($A1:INDEX($F:$F, MATCH(1E+99, $F:$F)))
In L12 as an array formula with CSE,
=MODE(IF(NOT(COUNTIF($K12:K12, $A1:INDEX($F:$F, MATCH(1E+99, $F:$F)))), $A1:INDEX($F:$F, MATCH(1E+99, $F:$F))))
Fill L12 right to P12.
Recommended: MINIF, MAXIF and MODEIF
Related
My data is regular but sparse. As an example, imagine 3 data points in A4, A14 and A24 ("a","b" and "c" respectively). I want to pull these into a table. I need it to be able to adapt to more data points (so there might be 20, might be 2, but always 10 rows apart starting in A4).
Currently, I'm handling this by using an index column (say B1:B3 with the array formula SEQUENCE(COUNTA(A:A),1,1,1), and then next to that having:
INDIRECT("R"&4+(B1-1)*10&"C1",FALSE)
but I have to drag this formula down, and I want it to update dynamically, the way the index column would.
I wanted to make this into a dynamic array by adapting the formula to:
INDIRECT("R"&4+(B1:B3-1)*10&"C1",FALSE)
or
INDIRECT("R"&4+(SEQUENCE(COUNTA(A:A),1,0,1)*10&"C1",FALSE)
It spills correctly, but both of these return arrays of #VALUE! errors instead of the expected {a,b,c}. Why would this be? Have you got any suggestions for handling this in other ways?
Try this as a cell formula
=INDEX(A:A,SEQUENCE(COUNTA(A:A),1,4,10))
for previous versions of Excel, without Sequence(), this will do
=INDEX(B1:B1000,(ROW(OFFSET($A$1,,,COUNT(B1:B1000)))-1)*10+4)
OR put the Distance (ex:10) in D3 / Start in D2 (ex:4) / Total no of Numbers in D1 (ex: D1 = Count(b1:b1000)) and write the formula:
=INDEX(B1:B1000,(ROW(OFFSET($A$1,,,$D$1))-1)*$D$3+$D$2)
up to you. (enter both as Array Formulas w ctrl+shift+enter)
B1:B1000 will contain up to 100 numbers... so adjust at will and keep small for speed
I have assigned 10 assessments in my class. The students can do all 10 but only their top 8 marks will count. I would like to use a formula that takes an average of the top 8 marks from 10 (in other words, it excludes the lowest two marks from the range).
I've tried to take an average of the top 8 marks but it gives me a reading over the top 8 rows. I used:
=AVERAGE(LARGE(B2:K2,ROW(1:8)))
Where my range of data is in Row 2, Columns B - K.
In order to average top/bottom values you need to use array formula:
You code is correct, simply press Ctrl+Shift+Enter to apply it as an array formula.
You formula will be surrounded by curly brackets:
{=AVERAGE(LARGE(B2:K2,ROW(1:8)))}
If you want to enter the formula normally, you can use
=AVERAGE(LARGE(B2:K2,{1,2,3,4,5,6,7,8}))
or
=AVERAGEIF(B2:K2,">"&SMALL(B2:K2,2))
or
=AVERAGEIF(B2:K2, ">=" & LARGE(B2:K2,8))
So how about :
=(sum(b2:k2)-sum(small(b2:k2,{1,2})))/8
Tested and works, but if the { don't work then:
=(sum(b2:k2)-sum(small(b2:k2,1)+small(b2:k2,2)))/8
I am using Excel 2003 and am trying to average every two rows of data in one column,
starting from A1 and ending in A4, for example,
1
2
1
2
I try to do this average on the B1 column/row as follows (based on this info)
=AVERAGE(IF(MOD(ROW(A1:A4),2)=0,A1:A4))
However, when doing the above, B1 returns a 0, even though I intended to get a 1.
What would be the best way to make this kind of averaging work?
=AVERAGE(IF(MOD(ROW(A1:A4),2)=0,A1:A4))
The above formula is an array formula. To finalize it you need to press ctrl+shift+enter simultaneously; not just enter. This has also been abbreviated as CSE.
When you do this correctly, excel will wrap the formula in braces (e.g. { and }) like this:
{=AVERAGE(IF(MOD(ROW(A1:A4),2)=0,A1:A4))}
You do not type these braces in yourself; they are added automatically when a formula is entered as an array formula.
The solution to the question was as follows:
{=AVERAGE(IF(MOD(ROW(A1:A4)-1,2)=0,A1:A4))}
where the {} appears after pressing ctrl+shift+enter due to it being an array formula (cannot type that in manually).
The -1 is the offset based on where the data starts, and depending on the modulus operation, since MOD(ROW(A1),2) was 1,
i.e.: if my data instead started on A27, and I instead wanted to average values in every 4 rows, then MOD(ROW(A27),4) would return a 3 and the formula would correspondingly be offset by -3.
You could avoid array formulas using the below:
=IF((INT(ROW()/2)=ROW()/2)=TRUE,AVERAGE((A1,OFFSET(A1,-1,0))),"")
Image:
I need a little help, I have an Excel book with a long list of customers and in the adjacent cell is ether a 1 or 0 depending if the customer has ordered in the past month.
How can I split this list into 2 lists on another page one been ordered in the past month and the other not ordered,
Im unable to use Macros due to security levels on the PC.
Thanks
Try,
'for ones
=INDEX(A:A, AGGREGATE(15, 7, ROW(B$2:INDEX(B:B, MATCH(1E+99, B:B)))/(B$2:INDEX(B:B, MATCH(1E+99, B:B))=1), ROW(1:1)))
'for zeroes
=INDEX(A:A, AGGREGATE(15, 7, ROW(B$2:INDEX(B:B, MATCH(1E+99, B:B)))/(B$2:INDEX(B:B, MATCH(1E+99, B:B))=0), ROW(1:1)))
Of course, you will have to modify to suit the different worksheet.
See the image below. Using array formulas (Ctrl+Shift+Enter) I entered this into D2:D8:
=IFERROR(INDEX(A2:A8,SMALL(IF(B2:B8,ROW(A2:A8)-ROW(A1)),ROW(A2:A8)-ROW(A1))),"")
and this into E2:E8:
=IFERROR(INDEX(A2:A8,SMALL(IF(1-B2:B8,ROW(A2:A8)-ROW(A1)),ROW(A2:A8)-ROW(A1))),"")
Explanation
This is how Excel will calculate the first formula:
=IFERROR(INDEX(A2:A8,SMALL(IF(B2:B8,ROW(A2:A8)-ROW(A1)),ROW(A2:A8)-ROW(A1))),"")
=IFERROR(INDEX(A2:A8,SMALL(IF({1;0;1;0;0;0;1},{2;3;4;5;6;7;8}-1),{2;3;4;5;6;7;8}-1)),"")
=IFERROR(INDEX(A2:A8,SMALL(IF({1;0;1;0;0;0;1},{1;2;3;4;5;6;7}),{1;2;3;4;5;6;7})),"")
=IFERROR(INDEX(A2:A8,SMALL({1;FALSE;3;FALSE;FALSE;FALSE;7},{1;2;3;4;5;6;7})),"")
Since the second argument of SMALL is an array, it will find the 1st, 2nd, 3rd, etc. value, ignoring FALSE (it will return #NUM! for the 4th through 7th value).
=IFERROR(INDEX(A2:A8,{1;3;7;#NUM!;#NUM!;#NUM!;#NUM!}),"")
=IFERROR({"A";"C";"G";#NUM!;#NUM!;#NUM!;#NUM!},"")
={"A";"C";"G";"";"";"";""}
I need to return a cell that has text in it, but am running into difficulty.
Above is a sample table I'm working with. What I'd like to be able to do, is lookup id 1 and have it output Rich. When I do a vlookup, however, it gives no output. And while vlookup min/max will output integers, they don't work with text. Does anyone know how I can scan multiple ids, but only output the filled text cell?
There may be a shorter formula for this but I banged this off quickly and it does dynamically truncate the ranges in column B down to the minimum number of rows necessary.
=INDEX(B:B, AGGREGATE(15, 6, ROW(B2:INDEX(B:B, MATCH("zzz",B:B )))/(ISTEXT(B2:INDEX(B:B, MATCH("zzz",B:B )))*(A2:INDEX(A:A, MATCH("zzz",B:B )))=D3), 1))
To retrieve a second, third, etc. entry change the k parameter of AGGREGATE to a COUNTIF and fill down.
=INDEX(B:B, AGGREGATE(15, 6, ROW(B$2:INDEX(B:B, MATCH("zzz",B:B )))/(ISTEXT(B$2:INDEX(B:B, MATCH("zzz",B:B )))*(A$2:INDEX(A:A, MATCH("zzz",B:B )))=D3), COUNTIF(D$3:D3, D3)))