+ Reply to Thread
Results 1 to 16 of 16

Count equal numbers in sequence

  1. #1
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Count equal numbers in sequence

    Good evening, I would need a formula that counts the sequence of N.1
    That we are in an interval.
    But I would need the sequence to the right.
    In the attached file you can see the expected result in column N.
    Thank you .
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Count equal numbers in sequence

    It's probably because you sued Google translate or similar.
    What do you mean by 'in an interval' ?

    Would it be that you want to select a number of columns and then count the ocurreces of the value 1 in that selection?
    You can do this with a macro and a right-click event in the worksheet
    I have a attached a file to try it out
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,913

    Re: Count equal numbers in sequence

    n2=COLUMN(M2)-LOOKUP(2,1/(A2:M2<>1),COLUMN(A2:M2))
    Try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Registered User
    Join Date
    03-26-2016
    Location
    São Paulo - Brazil
    MS-Off Ver
    2016
    Posts
    48

    Re: Count equal numbers in sequence

    Berna11

    Check if this is correct for you

    =COUNTIFS(A2:L2,A2,B2:M2,B2)

    Decio
    Attached Files Attached Files

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Count equal numbers in sequence

    I hope he answers at all, no reaction so far

  6. #6
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Count equal numbers in sequence

    Thank you for your answers and help.

    @Keebellach

    You almost understood what I would do.
    With the macro I have the desired result however I have to select on
    Each line the range to get the result.
    With a formula you would have the result on all the immediate lines.

    @nflsales
    Your error formula #Valore!
    Maybe better if you join the file

    @deciog
    It's not the result I'm looking for.


    Maybe I did not explain it well or the translation.
    I try to explain better:
    * Since the frequencies of n.1 in each line may be different,
    * I just want the sum of the last frequency of N.1 found
    * To the right of each line as highlighted in yellow.
    If possible with formula thanks again.

  7. #7
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Count equal numbers in sequence

    I apologize but the translation of the formula
    * Excel from English to Italian has betrayed me.
    I did not put one ";" After LOOKUP(2,1 =LOOKUP(2;1
    The nflsales formula now works.
    Thank you all.

  8. #8
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Count equal numbers in sequence

    Good morning I apologize if I return to the discussion
    but I would like if possible a variation in the formula if
    the numbering does not end up to the last column.

    In the attached file you can see line 2 where in N2 should
    give as a result 3 it should not consider empty cells.
    Thank you
    Attached Files Attached Files

  9. #9
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Count equal numbers in sequence

    Try

    N2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  10. #10
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Count equal numbers in sequence

    Try this one/Tenta questa

    Only the one where the last value is not blank and different 1 has to be editted stil.
    You need to define the last cell with the value 1 for it to work
    Attached Files Attached Files

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Count equal numbers in sequence

    @shukla.ankur281190: you're missing the one in row 5 too.

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Count equal numbers in sequence

    Try array entering this in N2 and filling down. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    1
    2
    0
    1
    1
    2
    2
    3
    3
    1
    1
    1
    3
    3
    1
    1
    2
    2
    2
    3
    3
    3
    1
    1
    1
    1
    1
    5
    4
    0
    0
    1
    1
    1
    2
    2
    0
    0
    0
    1
    1
    2
    0
    5
    0
    0
    1
    1
    1
    2
    2
    0
    0
    1
    1
    1
    1
    4
    Last edited by FlameRetired; 09-20-2017 at 04:00 AM.
    Dave

  13. #13
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Count equal numbers in sequence

    Perfect, thank you very much for working properly
    Thanks to the next

  14. #14
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Count equal numbers in sequence

    @FlameRetired: Tops!

  15. #15
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Count equal numbers in sequence

    Quote Originally Posted by Berna11 View Post
    ....thank you very much for working properly
    Thanks to the next
    You're welcome thanks for the feedback and rep and marking your thread Solved.

  16. #16
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Count equal numbers in sequence

    @ Keebellah,

    Thank you.

+ 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. count equal numbers on two columns for given number
    By pedersenn in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-15-2016, 01:59 PM
  2. How to convert a range of numbers to sequence of numbers in an array
    By MetisConnect in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-25-2015, 11:53 AM
  3. [SOLVED] Populate count & sum based on equal to & not equal to factors
    By jscalem in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-20-2015, 01:20 PM
  4. Replies: 3
    Last Post: 08-20-2013, 03:59 AM
  5. [SOLVED] Creating a sequence based on numbers in one column and adding "01,02..." to a new sequence
    By JCR1968 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-05-2013, 08:06 AM
  6. [SOLVED] Random numbers but 3 numbers in sequence not allowed.
    By NewGen in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-31-2012, 07:51 AM
  7. Count equal numbers in beginning of a column
    By FiddlerOnTheRoof in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2006, 03:10 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