+ Reply to Thread
Results 1 to 4 of 4

Counting only first occurance with two matching cells

  1. #1
    Forum Contributor
    Join Date
    10-13-2011
    Location
    Australia
    MS-Off Ver
    Office 16
    Posts
    329

    Counting only first occurance with two matching cells

    Hi all

    Looking for a match of data in cell d2 and E2, with a result only on the first occurance.
    it is almost a countif function, which i've used b4.
    Please Login or Register  to view this content.
    Now that works for one reference, but I need a match for both cells before it produces the 0 and 1 outcomes.
    I have loads of data down the sheet, so it would need to be copied down the page for the 'ooo s of entries I have.

    If it works, I'd prefer the outcome as 1 and 2 respectively.
    Please Login or Register  to view this content.
    But again, both D and E data need to match.

    thanks in advance.
    Chris
    Last edited by Christopherdj; 01-08-2013 at 02:36 AM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Counting only first occurance with two matching cells

    Hi Chris,

    Please share a sample sheet.. thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Counting only first occurance with two matching cells

    hi Chris, maybe:
    =IF(SUMPRODUCT((D$2:D2=D2)*(E$2:E2=E2))>1,2,1)

    or in Excel 2007 & above:
    =IF(COUNTIFS(D$2:D2,D2,E$2:E2,E2)>1,2,1)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Contributor
    Join Date
    10-13-2011
    Location
    Australia
    MS-Off Ver
    Office 16
    Posts
    329

    Re: Counting only first occurance with two matching cells

    Excellent result, thought it was a simple one.
    thank you very much.

+ 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