#1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default read Matrix

Hello,

If I have a matrix that looks something like

A
B 0 0.2 0.4 0.6 1
50% 1 2 3 4
70% 5 6 7 8
100 9 10 11 12


I nedd a funtion that will be able to read the matrix somthing like

=MyMatrix(A,B)


if A between o.4 and 0.2 and B between 50 and 70 then the result is 6
If A between o.4 and 0.6 and B between 50 and 70 then the result is 7

I presume I can do it with a lot of if statements but maybe there is a
cleaner and faster way to do it.


Many thanks
Dan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default read Matrix

If you arrange your matrix this way:

A B C D E F
1 0% 0 0,2 0,4 0,6 1
2 50% 1 2 3 4
3 70% 5 6 7 8
4 100% 9 10 11 12

then

=INDEX(C2:F4,MATCH(Bvalue,B1:B4,1),MATCH(Avalue,B1 :F1,1))

gives the required matrix element.

Regards,
Stefi


€žDan€ť ezt Ă*rta:

Hello,

If I have a matrix that looks something like

A
B 0 0.2 0.4 0.6 1
50% 1 2 3 4
70% 5 6 7 8
100 9 10 11 12


I nedd a funtion that will be able to read the matrix somthing like

=MyMatrix(A,B)


if A between o.4 and 0.2 and B between 50 and 70 then the result is 6
If A between o.4 and 0.6 and B between 50 and 70 then the result is 7

I presume I can do it with a lot of if statements but maybe there is a
cleaner and faster way to do it.


Many thanks
Dan

  #3   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default read Matrix

fantastic, many thanks

"Dan" wrote:

Hello,

If I have a matrix that looks something like

A
B 0 0.2 0.4 0.6 1
50% 1 2 3 4
70% 5 6 7 8
100 9 10 11 12


I nedd a funtion that will be able to read the matrix somthing like

=MyMatrix(A,B)


if A between o.4 and 0.2 and B between 50 and 70 then the result is 6
If A between o.4 and 0.6 and B between 50 and 70 then the result is 7

I presume I can do it with a lot of if statements but maybe there is a
cleaner and faster way to do it.


Many thanks
Dan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default read Matrix

You are welcome! Thanks for the feedback!
Stefi

€žDan€ť ezt Ă*rta:

fantastic, many thanks

"Dan" wrote:

Hello,

If I have a matrix that looks something like

A
B 0 0.2 0.4 0.6 1
50% 1 2 3 4
70% 5 6 7 8
100 9 10 11 12


I nedd a funtion that will be able to read the matrix somthing like

=MyMatrix(A,B)


if A between o.4 and 0.2 and B between 50 and 70 then the result is 6
If A between o.4 and 0.6 and B between 50 and 70 then the result is 7

I presume I can do it with a lot of if statements but maybe there is a
cleaner and faster way to do it.


Many thanks
Dan

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default read Matrix

If your matrix is in A1:E4, A value in G1 and B value in H1...

=INDEX(B2:E4,4-MATCH(H1,{1,0.7,0.5},-1),5-MATCH(G1,
{1,0.6,0.4,0.2},-1))

Ken Johnson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I transpose nXm matrix to mXn Matrix MIHir Excel Worksheet Functions 2 August 9th 08 11:44 AM
I have a read only xl file, I need it to be read and write drama queen Excel Discussion (Misc queries) 3 July 1st 06 12:25 AM
XCEL FILE REC'D AS READ ONLY -- HOW TO NOT BE "READ ONLY" billybob Excel Discussion (Misc queries) 1 February 13th 06 03:14 AM
How can a file be converted from Read-Only to Read/Write Jim in Apopka Excel Discussion (Misc queries) 2 November 19th 05 04:59 PM


All times are GMT +1. The time now is 05:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"