+ Reply to Thread
Results 1 to 8 of 8

Returning first "1"

  1. #1
    Registered User
    Join Date
    02-17-2017
    Location
    Poland
    MS-Off Ver
    2007
    Posts
    1

    Returning first "1"

    Hello everyone , i have a little problem i dont know how to show the first record which returns "1" for each year, in situation below the answer should be 4 and 8, the rest shouldnt be visible.How could i do that?

    1 2013 0
    2 2013 0
    3 2013 0
    4 2013 1
    5 2013 1
    6 2013 0
    7 2014 0
    8 2014 1
    9 2014 1

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,241

    Re: Returning first "1"

    Array Enter:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and drag down.

    An array entered formula is committed with Ctrl-Shift-Enter rather than just Enter
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,241

    Re: Returning first "1"

    To remove errors:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Returning first "1"

    Welcome to the forum.

    Trevor's assumed that the first column you showed (1 to 9) were just row numbers, with 2013/2014 in column A and the 0s/1s in column B.
    I'd assumed different, that your 1-9 are in column A with the 2013/14 in B and 0/1 in C, in which case use this (wrapping Index round his formula):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    or, removing the errors,
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    They're still array formulae, entered with Ctrl-Shift-Enter.

    Hope that helps, if my assumption's correct - if not, please ignore me and go with Trevor's answer!
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,241

    Re: Returning first "1"

    Guessing that should be
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Returning first "1"

    Quote Originally Posted by TMS View Post
    Guessing that should be...
    Yes, that works too, since the returned value is in the first column - probably simpler to understand too .

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Returning first "1"

    Here is a regular one
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B C
    1 2013 0 4
    2 2013 0 8
    3 2013 0
    4 2013 1
    5 2013 1
    6 2013 0
    7 2014 0
    8 2014 1
    9 2014 1
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,707

    Re: Returning first "1"

    martis941 will the years always be increments of 1 ... ie is it possible the next year could be 2016 or 2017?
    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: 07-12-2017, 05:32 PM
  2. Replies: 3
    Last Post: 11-11-2015, 03:44 PM
  3. [SOLVED] How to check two columns for the presence of text and returning "yes" or "no"
    By Karelia Suite in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-19-2013, 09:36 AM
  4. Returning Closest Match between "y" and "z" to "X"
    By promotor in forum Excel General
    Replies: 4
    Last Post: 12-05-2011, 10:34 AM
  5. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  6. Replies: 13
    Last Post: 06-08-2008, 12:48 PM
  7. Replies: 3
    Last Post: 12-14-2006, 01:36 PM

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