+ Reply to Thread
Results 1 to 4 of 4

[SOLVED] Sequential numbering of duplicates. COUNTIF but showing 1, 2, 3 etc.

  1. #1
    Registered User
    Join Date
    09-18-2018
    Location
    UK
    MS-Off Ver
    2010
    Posts
    9

    [SOLVED] Sequential numbering of duplicates. COUNTIF but showing 1, 2, 3 etc.

    Hiya,

    I need a formula that will count the duplicate dates in the Short Date column, as I need each event to have a reference number. I also need that reference number to begin at 2, as only Public Holiday events should have a reference of 1.

    I have managed to create what I want (in the IFs column) so you can see what I mean, but the problem with it is that if the user deletes an event from anywhere except the bottom, the referencing in the columns is broken and throws up an error. The user will then have to recalculate the whole column any time they delete an event. I want this reference column to be completely automated and hide it from the user, so this doesn't work for me!

    I tried using a countif, but couldn't quite get it to work, and found out in the process that I couldn't use countifs anyway, as my original document is large and complex and countifs slow it down way too much!

    Hopefully someone can help
    Thanks!
    Attached Files Attached Files
    Last edited by Tigerlilygem; 12-03-2018 at 08:29 AM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Sequential numbering of duplicates. COUNTIF but showing 1, 2, 3 etc.

    If you want the formula to withstand row deletion, then you need to use COUNTIFS. You don't fully explain what "Not an event" means to your numbering scheme, but try this version.

    =IF([@Department]="Public Holiday",1,1+MAX(1,COUNTIFS($C$1:C2,C2,$H$1:H2,"Event")))

    If that is too slow, then you could disallow row deletions and use a flag that is used in your formula, like "Cancelled event"... or you could use a macro to update the values as values when needed.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Sequential numbering of duplicates. COUNTIF but showing 1, 2, 3 etc.

    Maybe this but still need countifs

    C2
    =IF(H2="Public Holiday",1,(COUNTIFS(C$2:C2,C2,H$2:H2,"<>Public Holiday")+1))

  4. #4
    Registered User
    Join Date
    09-18-2018
    Location
    UK
    MS-Off Ver
    2010
    Posts
    9

    Re: Sequential numbering of duplicates. COUNTIF but showing 1, 2, 3 etc.

    Thank you both! They seem to work so I'll give them a go on the original document and see if the countifs make it too slow

+ 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] Countif/ifs formula but not counting duplicates
    By vito11 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-22-2017, 09:58 AM
  2. Sequential Numbering
    By chipd512 in forum Excel General
    Replies: 1
    Last Post: 11-25-2015, 03:39 PM
  3. Countif without counting duplicates
    By erice in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-13-2014, 06:16 PM
  4. Sequential Numbering
    By izzorac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2014, 10:15 PM
  5. Count Total of items in a column w/o counting duplicates or blanks
    By Clairebear4 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-23-2013, 10:56 PM
  6. sequential numbering
    By mulanfox in forum Excel General
    Replies: 0
    Last Post: 07-26-2011, 11:18 PM
  7. Sequential numbering
    By REELAXER in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 12:05 PM

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