+ Reply to Thread
Results 1 to 7 of 7

Function for Last year of production

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Bryne, Norway
    MS-Off Ver
    Microsoft Office Excel 2010
    Posts
    230

    Function for Last year of production

    I have two rows with years and production like below:

    2009 2010 2011 2012 2013 2014
    4 4 4 4 0 0

    I want to find last year with production which is 2012. Do any of you know about any function I can use for this?

    Magne (Norway)
    Last edited by mkvassh; 02-11-2009 at 07:15 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Function for Last year of production

    One way ...

    G2: =MAX(IF($A2:$F2,$A$1:$F$1))
    commited with CTRL + SHIFT + ENTER

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Function for Last year of production

    Hi,

    Presuming your data begins at cell A1, and that there will be no years with zero production,

    =INDEX(A1:J1,MATCH(0,A2:J2,-1)-1)
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Function for Last year of production

    I'd go with Sweep's if as mentioned you have no years of 0 production preceding those with production.

  5. #5
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Bryne, Norway
    MS-Off Ver
    Microsoft Office Excel 2010
    Posts
    230

    Re: Function for Last year of production

    Thank you both. I used match/index and it works. Another challenge. What if I have zero prodution in 2011 and a negative number in 2013. Are there any proposals for that situation. Year 2013 is the year I'm looking for then. By other words this.

    2009 2010 2011 2012 2013 2014
    4 4 0 4 -2 0

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Function for Last year of production

    The Array provided in post 2 should cover all bases.

  7. #7
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Bryne, Norway
    MS-Off Ver
    Microsoft Office Excel 2010
    Posts
    230

    Re: Function for Last year of production

    It does. Thank you very much :-)

+ 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