Excel Count the Number of Consecutive Cells

Posted on 2011-10-05
Last Modified: 2012-05-12
In a spreadsheet, Column B has ID #'s. The ID #'s can appear once, or repeat numerous times down the column until the next ID appears. I would like to create a new column C that will calculate the number of times each ID appears in Column B, next to the ID itself. For example, if ID 2356 appears in rows 13, 14, 15, 16, in Column B, then in Column C, there would be  a 4 next to each of the ID's in these rows.

Hope this made sense.

Thank you.

Question by:tahirih
    LVL 92

    Accepted Solution

    Use COUNTIF:

    LVL 10

    Assisted Solution

    Check attachement click on the Run button or run the macro

    Author Closing Comment

    Thank you.
    LVL 10

    Expert Comment

    you can use Piviot table

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
    How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
    This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now