+ Reply to Thread
Results 1 to 8 of 8

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,

    I am wondering if you all could help me.

    I have a large database which has some other formula in it but I am having trouble in getting either "Primary" or "Secondary" value returned in Column C against each entry of column A "code" if its matches with the same date in a date column B. it would be great if i could have some of your thoughts on it.

    OUTLET DATE Primary/ Secondary[/B]
    1433079 21/06/2013 Secondary
    1431970 01/08/2013 Primary
    1431970 01/08/2013 Primary

    1442690 21/06/2013 Primary
    1432001 31/07/2013 Secondary
    1433382 21/06/2013 Secondary
    1434057 17/05/2013 Secondary
    2591467 21/06/2013 Secondary
    1442690 21/06/2013 Primary
    1432040 01/08/2013 Secondary
    1431970 01/08/2013 Primary
    1432043 01/08/2013
    1442407 21/06/2013
    1432044 01/08/2013
    1432051 31/07/2013
    1432073 01/08/2013
    1432092 01/08/2013
    1432840 21/06/2013
    1432840 17/05/2013
    1432106 01/08/2013
    1432115 01/08/2013
    1442669 21/06/2013
    1432123 01/08/2013


    The sample sheet is attached for your reference.

    Thank you in advance.

    Shido
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Return Text based on criteria

    C2: =IF(COUNTIFS(A:A,A2,B:B,B2)=1,"Secondary","Primary")

    copy down as far as needed

  3. #3
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Return Text based on criteria

    try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Don't just use the answers provided for you. Try to understand how it works by reverse engineering or asking about it.

    Please mark the thread as [SOLVED] (Thread Tools->Mark thread as Solved) when answered.
    If you're happy with an answer given, please click the * under the person's name to boost their reputation.

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

    Re: Return Text based on criteria

    =IF(COUNTIFS(A:A,A2,B:B,B2)>1,"Primary","Secondary")
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Valued Forum Contributor
    Join Date
    09-04-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    463

    Re: Return Text based on criteria

    use the followIng formula In cell D2
    HTML Code: 
    use the followIng formula In cell C2
    HTML Code: 
    If It was really helpful to you then dont forget to hIt * button for user reputatIon.

    Regards
    CA Mahaveer SomanI

  6. #6
    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 your help Teethless mama. your code is simple and easy to understand. I appreciate your time and effort.

  7. #7
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Return Text based on criteria

    You're Welcome!

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

    Re: Return Text based on criteria

    Thanks All, I appreciate your help and time.

    Good luck
    Last edited by shido; 09-04-2013 at 07:13 PM.

+ 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 if True based on multiple criteria
    By JonnyMa in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-21-2013, 06:57 PM
  2. [SOLVED] Return text value with lookup based on multiple criteria?
    By mdispbee in forum Excel General
    Replies: 3
    Last Post: 06-22-2012, 08:30 AM
  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