+ Reply to Thread
Results 1 to 9 of 9

Identify only FIRST example(s) of "1" in columnar data where "1" may occur contiguously

  1. #1
    Registered User
    Join Date
    09-05-2012
    Location
    St Albans, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Angry Identify only FIRST example(s) of "1" in columnar data where "1" may occur contiguously

    Excel problem currently defying all rational logic and work-round attempts...

    ONE column (generated by legit data from various other columns) procures a string of CORRECT data - simply as "1" (true) or "0" or "False" OK great! it's what I wanted... but now I want a NEW column to flag only the first occurence in contiguous string of 1's - isloated occurences of 1's must still be flagged, but where 2 or more 1's are sequential ONLY the first 1 in the sequence is to be flagged... repeated also in later recurrent "strings of 1's" your suggestions please... cheers

    Second request - can anyone please send me a link to a full set of syntax rules for Excel formulae? - it seems to defy all rational logic including Boolean!

    Thank you

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Identify only FIRST example(s) of "1" in columnar data where "1" may occur contiguousl

    Can you post some sample data and the results you want (based on that sample) so we'll have a better idea of what you're working with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    09-05-2012
    Location
    St Albans, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Identify only FIRST example(s) of "1" in columnar data where "1" may occur contiguousl

    Cheeky - thank you for your response - I have attached a simple example; -

    Column A is the raw data and column B is a manually created example of my requirement.

    Thank you.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    12-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    232

    Re: Identify only FIRST example(s) of "1" in columnar data where "1" may occur contiguousl

    Hey there,
    So I'm new to Excel and this forum, but I wanted to take a crack at this problem. This is what I figured out:

    Paste B2 Down and Up. IF you copy it right to B1 it will #REF.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-05-2012
    Location
    St Albans, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Identify only FIRST example(s) of "1" in columnar data where "1" may occur contiguousl

    Solution is: - =IF(A2=1,IF(A1<>1,1,""),"")

  6. #6
    Forum Contributor
    Join Date
    12-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    232

    Re: Identify only FIRST example(s) of "1" in columnar data where "1" may occur contiguousl

    Quote Originally Posted by Bebbspoke View Post
    Solution is: - =IF(A2=1,IF(A1<>1,1,""),"")
    That won't work. It's close but I think you wanted to say: =IF(A2=1,IF(A1<>1,1,""),"") Which is shorter than mine; but does not fill in the rest. Still A1 will #ref.
    Last edited by nemo74; 12-14-2012 at 08:20 PM.

  7. #7
    Registered User
    Join Date
    09-05-2012
    Location
    St Albans, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Identify only FIRST example(s) of "1" in columnar data where "1" may occur contiguousl

    Thanks for your comment Nemo - but the solution I gave DOES work - I'm not going to discuss why you doubt it. - I am happy with the function.

    PLEASE - will somebody produce link to all formulae syntax? - It would fractionate the time wasted on sites such as this, thank you.

  8. #8
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Identify only FIRST example(s) of "1" in columnar data where "1" may occur contiguousl

    Forgetting B1, maybe this shorter formula..

    =IF(AND(A2=1,A1<>1),1,"")
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  9. #9
    Registered User
    Join Date
    09-05-2012
    Location
    St Albans, UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Identify only FIRST example(s) of "1" in columnar data where "1" may occur contiguousl

    Thanks Ace - satisfied with solution obtained

+ 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