arrays problems

ystrica

New Member
Joined
May 8, 2012
Messages
18
Hi, Hoping for some help.

i have sample data set 6 x 4 from which i need to extract rows numbers of specific values. The right result should be {3;4} or 3
4

I have the formula which generates: FALSE------FALSE
-------------------------------------3---------FALSE
------------------------------------FALSE--------4

But how to proceed further i have no idea. .. Think that what you have is this 3x3 matrix and you need to get 3 and 4 there in one of two forms - or {3,4} or 3
4
Any help? Please...
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Could you post the actuall matrix witd desired result?

Thanks for replaying !

--------John--------coef-------Inga--------coef------------Alise---------coef------------today()
John---1/1/2012--1.6887104-1/6/2012---1.371252155-----1/3/2012-----1.040553927-----2/14/2012
Alise---2/15/2012 -0.9871740-2/2/2012---0.807606883-----2/4/2012-----0.602202203--------
-------1/25/2012--0.0797611-3/31/2012--0.11607469------3/15/2012----0.575847398


i'm trying to make one formula (in fact i have no choice), that:
1. Looks for the names aside and finds these names in the table.
2. Looks for the date aside and finds the earliest date in each "dates column" of the table that which is still greater then than the date of today.
3. Then finds all coefficients, than stand next to the dates from 2 and correspond to the names from


=INDEX($B$1:$G$4,{3;4},MATCH($A$2:$A$4,$B$1:$G$1,0)+1) provides desirable result, but right now uses manual arguments ({3;4}), which is not acceptable:
0.98717401
0.575847398


{3;4} are rows numbers, can be received from :

=IF(INDEX(B1:G4,ROW(B2:G4),TRANSPOSE(MATCH(A2:A3,B1:G1,0))))>=H2,ROW(INDEX(B1:G4,ROW(B2:G4),(TRANSPOSE(MATCH(A2:A3,B1:G1,0))))))

which produces:FALSE FALSE
-----------------3-----FALSE
---------------FALSE-----4

And i need it as {3;4}. You see the problem?..
 
Last edited:
Upvote 0
Maybe

Array formula in J2
=INDIRECT(TEXT(MIN(IF($B$1:$G$1=$A2,IF(INDEX($B$2:$G$4,0,MATCH($A$2,$B$1:$G$1,0))>$H$2,ROW($B$2:$G$4)*10^4+COLUMN($B$2:$G$4)+1))),"R0000C0000"),0)

confirmed with Ctrl+Shift+Enter

copy down

M.
 
Upvote 0
oops...

The formula above works only if the dates in each column are ordered (ascending)

M.
 
Upvote 0
oops again (sorry)

There is a typo in the formula (wrong absolute reference)

This is ok (if dates are ascending ordered in each column)

J2
=INDIRECT(TEXT(MIN(IF($B$1:$G$1=$A2,IF(INDEX($B$2:$G$4,0,MATCH($A2,$B$1:$G$1,0))>$H$2,ROW($B$2:$G$4)*10^4+COLUMN($B$2:$G$4)+1))),"R0000C0000"),0)

Ctrl+Shift+Enter

copy to J3

M.
 
Upvote 0
This new version doesn't require that the dates are in order.

=INDIRECT(TEXT(MIN(IF($B$1:$G$1=$A2,IF($B$2:$G$4=MIN(IF($B$1:$G$1=$A2,IF($B$2:$G$4>$H$2,$B$2:$G$4))),ROW($B$2:$G$4)*10^4+COLUMN($B$2:$G$4)+1))),"R0000C0000"),0)

Ctrl+Shift+Enter

M.
 
Upvote 0
This new version doesn't require that the dates are in order.

=INDIRECT(TEXT(MIN(IF($B$1:$G$1=$A2,IF($B$2:$G$4=MIN(IF($B$1:$G$1=$A2,IF($B$2:$G$4>$H$2,$B$2:$G$4))),ROW($B$2:$G$4)*10^4+COLUMN($B$2:$G$4)+1))),"R0000C0000"),0)

Ctrl+Shift+Enter

M.

Thank you for your solution, i'm sure now i underestimated indirect function. The problem is that this formula works only if is displayed on the worksheet. I have to get these coefficients as array and use it as array-variable in a regression. This regression will be run 500 times with different names and dates. so i have no option to display the output of our formula. It will be used only as argument inside other functions. Do you see the problem?? But i really appreciate your help.
 
Upvote 0
i showed you a way on the other forum the offset can be used inside any other function,you could make it a named formula to cut down size..unless you mean something else..
 
Upvote 0

Forum statistics

Threads
1,216,753
Messages
6,132,514
Members
449,731
Latest member
dasda34

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