+ Reply to Thread
Results 1 to 9 of 9

Formula to define (1,0) first time a value appears in a colum matching one conditions

  1. #1
    Registered User
    Join Date
    01-16-2014
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    4

    Lightbulb Formula to define (1,0) first time a value appears in a colum matching one conditions

    Hello there!

    I’m stuck trying to find a formula that result 1 or 0; 1 for the first time a value appears in a column and meet a condition. Values are repeated and I have a lot of different registers.

    It might be easy but I can’t figure it out.

    Attached is a sample of what I have and what I need in case I’m not clear enough in my post.

    I really hope there is someone out there that can help me with it... pls!!

    Regards,
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Formula to define (1,0) first time a value appears in a colum matching one conditions

    Could you explain how you get to the results you show please? If you want 1 for the 1st time an item appears, then I would have expected the very 1st row (at least) to be 1?

    edit: my thoughts too, Ace
    Last edited by FDibbins; 01-16-2014 at 02:04 AM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

    Re: Formula to define (1,0) first time a value appears in a colum matching one conditions

    Try

    =--(COUNTIF(C$2:C2,C2)=1)

    Copy down

    Note: Shouldn't first result be 1?
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    01-16-2014
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Formula to define (1,0) first time a value appears in a colum matching one conditions

    FDibbins and Ace_XL the first answer should be 0, because it is the first time that the value appears in the list but the condition of column B is not met (it equals to zero).

    I see your formula but I don’t see the inclusion of the condition of B column. Beside this, and for future exercise, why do you begin the formula with (=) double hyphen.

    I’ll keep reading you.

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

    Re: Formula to define (1,0) first time a value appears in a colum matching one conditions

    In Row 2

    =--(AND(B2=1,COUNTIFS(C$2:C2,C2,B$2:B2,1)=1))

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Formula to define (1,0) first time a value appears in a colum matching one conditions

    You have not been very specific about which info you are testing.

    I have tried both of these, and the results dont match yours....
    =IF(B2=0,0,IF(COUNTIF($A$2:A2,A2)>1,0,1))
    =IF(B2=0,0,IF(COUNTIF($C$2:C2,C2)>1,0,1))

    Please tell us EXACTLY what you are testing/comparing, otherwise we all waste time guessing

  7. #7
    Registered User
    Join Date
    01-16-2014
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Formula to define (1,0) first time a value appears in a colum matching one conditions

    Sure, what I’m testing is:
    if in column A (a customer ID, repeated values), B equals to 0, the result of the formula in column C should be 0. But the first time that customer ID is appears (even if it is repeated in the list) with 1 in B, the result is one. And, whenever ahead the same customer ID appears, no matter the B value, the results in column C should be 0 because it is been already marked with 1 the first time it meets the condition (B=1).

    So, what I’m looking is to have a column that if sum gives unique customers that have do something (1 in B).

    A – B - C
    1: 1 – 0 - 0
    2: 2 – 0 - 0
    3: 3 – 0 - 0
    4: 1 – 1 - 1
    5: 2 – 1- 1
    6: 1 - 1- 0
    7: 2 - 1 - 0
    I really hope it is clearer now; I don’t want to waste your time in any way.

    Thank you very much.

  8. #8
    Registered User
    Join Date
    01-16-2014
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Formula to define (1,0) first time a value appears in a colum matching one conditions

    Ace_XL your =--(AND(B2=1,COUNTIFS(C$2:C2,C2,B$2:B2,1)=1)) did what I need, THANK YOU VERY MUCH!!

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Formula to define (1,0) first time a value appears in a colum matching one conditions

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Formula Help matchin colum a with colum b to display colum c
    By dbe82 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-08-2013, 10:11 PM
  2. [SOLVED] LookUP formula matching muitiple conditions
    By Excel Dumbo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-08-2013, 08:56 PM
  3. [SOLVED] Matching 3 conditions excel formula
    By PRADEEPB270 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-18-2013, 01:05 AM
  4. Replies: 0
    Last Post: 12-29-2011, 04:48 PM
  5. Replies: 3
    Last Post: 08-14-2011, 01:47 PM

Tags for this Thread

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