+ Reply to Thread
Results 1 to 5 of 5

Return Text based on criteria

  1. #1
    Forum Contributor
    Join Date
    07-08-2010
    Location
    ireland
    MS-Off Ver
    Excel 2007
    Posts
    121

    Return Text based on criteria

    Hi All,

    Referring to the original post http://www.excelforum.com/excel-form...-criteria.html, there is a small addition to a condition shared earlier.

    I want to use the formula which return at first "primary" and than "secondary" if the outlet has two or more same date, like 1431970. For the rest of outlet, if not have same date, it return "Primary".

    OUTLET TBC DATE Primary/ Secondary
    1431970 01/08/2013 Primary
    1431970 01/08/2013 Secondary
    1431970 01/08/2013 Secondary
    1432001 31/07/2013 Primary
    1433382 21/06/2013 Primary
    1434057 17/05/2013 Primary
    1442690 21/06/2013 Secondary
    1432040 01/08/2013 Primary
    1431970 01/08/2013 Secondary
    1432043 01/08/2013 Primary
    1432043 01/08/2013 Secondary
    1432051 31/07/2013
    1432073 01/08/2013
    1432092 01/08/2013

    Hope you got my point.

    Thank you again

    Shido
    Attached Files Attached Files

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Return Text based on criteria

    Try this...

    Data Range
    A
    B
    C
    1
    OUTLET
    TBC DATE
    Primary/ Secondary
    2
    1431970
    1/8/2013
    Primary
    3
    1431970
    1/8/2013
    Secondary
    4
    1431970
    1/8/2013
    Secondary
    5
    1432001
    31/07/2013
    Primary
    6
    1433382
    21/06/2013
    Primary
    7
    1434057
    17/05/2013
    Primary
    8
    1442690
    21/06/2013
    Primary
    9
    1432040
    1/8/2013
    Primary
    10
    1431970
    1/8/2013
    Secondary
    11
    1432043
    1/8/2013
    Primary
    12
    1432043
    1/8/2013
    Secondary
    13
    1432051
    31/07/2013
    Primary
    14
    1432073
    1/8/2013
    Primary
    15
    1432092
    1/8/2013
    Primary

    This formula entered in C2 and copied down:

    =IF(COUNTIFS(A$2:A2,A2,B$2:B2,B2)=1,"Primary","Secondary")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Return Text based on criteria

    =IF(OR(A2="",B2=""),"",IF(COUNTIFS($A$2:A2,A2,$B$2:B2,B2)=1,"Primary","Secondary"))
    If you are http://www.excelforum.com/image.php?type=sigpic&userid=125481&dateline=1392355029happy with the results, please add to the contributor's
    reputation by clicking the reputation icon (star icon).




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.
    To undo, select Thread Tools-> Mark thread as Unsolved.
    http://www.excelaris.co.uk

  4. #4
    Forum Contributor
    Join Date
    07-08-2010
    Location
    ireland
    MS-Off Ver
    Excel 2007
    Posts
    121

    Re: Return Text based on criteria

    Thank you for both of your help. it was simple which i couldn't think of but you made my problem solved. Thanks once again.. cheers

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Return Text based on criteria

    You're welcome. We appreciate the feedback!

+ 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. [SOLVED] Return Text based on criteria
    By shido in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-04-2013, 04:08 PM
  2. [SOLVED] Return Text if True based on multiple criteria
    By JonnyMa in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-21-2013, 06:57 PM
  3. Replies: 1
    Last Post: 01-20-2012, 09:44 AM
  4. Return a Text Value based on criteria
    By SeanKosmann in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-26-2010, 04:08 PM
  5. Return text based on criteria
    By PearlJam in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-02-2009, 08:58 AM

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