dynamic array formula needed

Scott R

Active Member
Joined
Feb 20, 2002
Messages
457
Office Version
  1. 365
Platform
  1. Windows
Say that A1:C3 contains 1,2,3;6,5,4;8,7,9 and E1 = A1:C3 making E1 a dynamic cell.

In I1, I've got =SUBTOTAL(5, OFFSET(E1#, SEQUENCE(3,,0),, 1)) to find the minimum value of each row in the 3x3 matrix, or 1;4;7. This is also a dynamic cell.

I'm trying to build a dynamic array formula, using both dynamic cells E1 and I1, to return the column position of the row's minimum value, or in this example 1;3;2
1 is the minimum in row 1 which is in column position 1
4 is the minimum in row 2 which is in column position 3
7 is the minimum in row 3 which is in column position 2

I've tried combinations of INDEX, MATCH, OFFSET, SEQUENCE, etc. but no luck.

Thanks for the help!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Do you really need the helper cells, you could just use
Excel Formula:
=BYROW(A1:C3,LAMBDA(br,FILTER({1,2,3},br=MIN(br))))
 
Upvote 0
No, helper cells not required.
My Excel 365 doesn't have BYROW or LAMBDA unfortunately. Killing me.
 
Upvote 0
In that case off-hand I can't think of any way to do it so that it spills down.
 
Upvote 0
Thx for looking. I can't seem to find one either.

Guess that's why there's a BYROW function.
 
Upvote 0
Found a solution....

I put column positions in a dynamic array; in K1: =COLUMN(E1#) - COLUMN(E1) + 1

Then in O1: =SUMIF(OFFSET(E1#, SEQUENCE(ROWS(E1#),, 0),, 1), I1#, K1#)

A bit of a journey but it does what I need it to do.
 
Upvote 0
Solution
Glad you sorted it & thanks for the feedback.
 
Upvote 0
The SUMIF only works because the values in my dataset (E1#) are never identical by row.
 
Upvote 0
the values in my dataset (E1#) are never identical by row.
Would this work for you then without helpers?

22 10 08.xlsm
ABCDEFGHIJKLMNO
112312311
265465443
387987972
Scott R
Cell Formulas
RangeFormula
E1:G3E1=A1:C3
I1:I3I1=SUBTOTAL(5, OFFSET(E1#, SEQUENCE(3,,0),,1))
O1:O3O1=FILTERXML("<p><c>"&TEXTJOIN("</c><c>",1,IF(I1#=E1#,COLUMN(E1#)-COLUMN(E1)+1,""))&"</c></p>","//c")
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,220
Members
448,876
Latest member
Solitario

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top