+ Reply to Thread
Results 1 to 6 of 6

Count maximum times same number used in a row by criteria

  1. #1
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Count maximum times same number used in a row by criteria

    Tricky one to explain, but example attached.

    Is it possible to count the amount of times a number is used in succession?

    For example if you have in column A the name of the location and Column B a serial number. Can you count the maximum amount of times the same serial number is used in succession for that location name.

    I don't want the total count of the serial number just the maximum times the same one is used in a row

    Sorry for the awful explanation, the example file should be clear though. Thank you for any help
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Count maximum times same number used in a row by criteria

    Hi mrsak,

    I can do this problem for a single value using a helper column. Perhaps one of the smart gurus can do a single formula for multiple and different values. See the attached with my answer.

    Max string of values in column using helper.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,694

    Re: Count maximum times same number used in a row by criteria

    ARRAY formula in H6 then drag down.
    No helper column.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 05-10-2018 at 11:20 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Count maximum times same number used in a row by criteria

    =max(frequency(if(($a$2:$a$52=$e6)*($b$2:$b$52=$f6),row($a$2:$a$52)),($b$2:$b$52<>$f6)*row($a$2:$a$52))) cse

  5. #5
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Count maximum times same number used in a row by criteria

    Hi, again

    Thank you for your replies, it's so close to what I want! Is it possible to have the serial value returned as well as how many times it's consecutively used instead of having to input that too?

    So the maximum consecutive amount of the same serial value per location and then also return that serial value?

    I can do that using a helper column as suggested by Marvin, but is that also possible using a single formula?

  6. #6
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Count maximum times same number used in a row by criteria

    i'd prefer UDF
    formula with worksheet functions would be huge without helper column
    Attached Files Attached Files

+ 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] Count the number of times data meats a criteria
    By Terry-J in forum Excel General
    Replies: 6
    Last Post: 05-11-2016, 12:45 PM
  2. Count number of times one value is higher than another IF criteria is true
    By LasseKaa in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-17-2013, 11:28 AM
  3. Replies: 4
    Last Post: 11-07-2013, 09:41 AM
  4. Counting number of times a maximum exceeds a threshold on a certain frequency
    By varsakov in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-04-2013, 02:21 PM
  5. Macro that sets maximum number of times a workbook is opened
    By Mark1011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2012, 08:41 AM
  6. how do i count the number of times criteria appears in a worksheet
    By MarkWatson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2006, 02:15 AM
  7. Replies: 3
    Last Post: 02-03-2005, 06:06 AM

Tags for this Thread

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