+ Reply to Thread
Results 1 to 4 of 4

matrix problem

  1. #1
    Registered User
    Join Date
    11-09-2011
    Location
    Seville
    MS-Off Ver
    Excel 2007
    Posts
    91

    matrix problem

    Hi all,

    I can't find a formula to deal with this. The problem is described in the attachment, in column R I want to get those results by using a formula. I have a matrix (A:P) whose cells values are 0 (not seen) or 1 (seen), the columns indicate the years (1996-2011) and in column Q I have the birth years of these individuals (each row is an individual). I want to get the age when they were first time seen.
    So, in column R I have that the age when the first individual (first row) was seen is 0, because he was born in 1998 and seen the first time in 1998, the 3rd individual is 2 because he was born in 1996 and seen the first time in 1998 and so on.

    Any hint on how to do that?
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: matrix problem

    You could use this formula in R2:

    =INDEX(A$1:P$1,MATCH(1,A2:P2,0))-Q2

    and then copy down.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    11-09-2011
    Location
    Seville
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: matrix problem

    Thank you so much,

    I was doing it by sorting the birth years and by substituting the values 1996=1 up to 2011=16 and by using a formula with just "match" but it was much more "ugly" and laborious. Thanks to show me how to use function "index" and "match" to do that.

    Quote Originally Posted by Pete_UK View Post
    You could use this formula in R2:

    =INDEX(A$1:P$1,MATCH(1,A2:P2,0))-Q2

    and then copy down.

    Hope this helps.

    Pete

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: matrix problem

    You're welcome - glad to be of help.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1