+ Reply to Thread
Results 1 to 21 of 21

Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

  1. #1
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Question Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Hi ΤΟ ΑΛΛ Could you please help me on the following?:So i have an A column with results of 1 or 2 like that:

    1
    2
    1
    2
    1
    2
    1
    1
    2
    2
    .
    .
    .
    .

    So the formula i need is about the last 4 numbers event ,If 2 2 (or 1 1) comes count 1, if 1 1 2 2 (or 2 2 1 1) count 2 ,if 1 1 2 2 1 1 count 3 IF 11221122 , 4etc.Thank You.
    Last edited by AliGW; 12-30-2018 at 09:21 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Count doubles that occur ΑΤ ΤΗΕ ΣΑΜΕ ΤΙΜΕ

    Congratulations on finally starting your own thread!

    So, in the sample provided, what is the answer? is it 2? And what do the dots (.) represent?

    It would be easier if you uploaded a workbook.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Thank You Ali! So we have aseries of numbers from 1-36 which they 18 of them are 1 and the remaining 2 sa per attachment. I would like a formula to count me only the doubles
    like this : 11 must be count as 1 , 22 as 1 , 11 22 must be count as 2, 11 22 11 must be count as 3, 22,11,22,11 must be count as 4.Examble: lets say the outcome is
    11 22 11 the formula must count 3 ,if the next outcome is 1 then count 0.

    I try to upload but i cant.
    Last edited by louis128; 12-30-2018 at 09:46 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Please try again. We only need a small sample of data.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  5. #5
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    I would like to count the doubles that are happening at the same time.
    Last edited by louis128; 01-05-2019 at 02:05 PM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    In what way does it not work? Have you followed the instructions I gave? If the workbook is too large, then use a smaller workbook with a subset of your data.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    No need. Set up Two Named ranges (CTRl-F3 to view/wedit):

    First
    =Sheet1!$A$1:INDEX(Sheet1!$A:$A,MATCH(1E+100,Sheet1!$A:$A)-1)

    Second
    =Sheet1!$A$2:INDEX(Sheet1!$A:$A,MATCH(1E+100,Sheet1!$A:$A))

    Then use this formula:
    =SUMPRODUCT(--(First=Second))

    It will need to be modified if triples (1 1 1 or 2 2 2) can occur. can they?


    You may need ; instead of ,
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 12-30-2018 at 10:03 AM. Reason: Forget this: I misread the requirement and am leaving now.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  8. #8
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Thank Clenn!So much! But see the Examble: lets say the outcome is
    11 22 11 the formula must count 3 ,if the next outcome is 1 then count 0.So if 11 22 11 22 is 4 but if 11 22 11 22 and next result is 2 must show 0 zero . At the file you send me if the next result is 2 it counts 5 instead of 0 zero.
    Tribles no.
    Last edited by louis128; 12-30-2018 at 10:17 AM.

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

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Assume that no triple number, Data in Column A.
    Please try at B1

    =IFERROR(MATCH(0,INDEX(--(INDEX(A:A,COUNT(A:A)-6):INDEX(A:A,COUNT(A:A))=INDEX(A:A,COUNT(A:A)-7):INDEX(A:A,COUNT(A:A)-1)),N(IF(1,{7,5,3,1}))),)-1,4)
    Attached Files Attached Files

  10. #10
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Thank you Bo!!.we are very near, at the workbook you send me if 1 have in A 121122112211 it should count 5 not 4.
    Second in A 1212(without double )it should show o zero.
    we count all doubles if exist if no zero.
    I appreciate it !!!
    Last edited by louis128; 12-30-2018 at 10:39 AM.

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

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    I thought you say last 4 numbers event.

    If not last 4 double then

    C2 with Ctrl+Shift+Enter
    =IFERROR(MATCH(0,INDEX(--(A2:INDEX(A:A,COUNT(A:A))=A1:INDEX(A:A,COUNT(A:A)-1)),N(IF(1,COUNT(A:A)-INT(ROW(INDIRECT("1:"&INT(COUNT(A:A)/2)))*2)+1))),)-1,INT(COUNT(A:A)/2))
    Attached Files Attached Files

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    As far as I can see, Louis wants to count the number of doubles that exist at the end of the list, not just the final four pairs.

  13. #13
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Dear Ali I can say that Bo_Ry make the job 99%done!.Thank You .

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Yes, Louis, and I am trying to help you to get the 100% result you want.

  15. #15
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Thank so much .You are Great!

  16. #16
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Can i ask for one more thing please can i have a formula that counting 121212 etc , in this case should count 3 if 2 comes(1212122) then count 0

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    That contradicts your originsl requirement, where XXXX22 counts as 1. Now it counts as 0.

    So what DO you want?

  18. #18
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Dear Clen ,the new formula iam asking is about counting the 12 as 1 ,example: 121212 etc , in this case should count 3 if 2 comes(1212122) then count 0

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

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Please try this with Ctrl+Shift+Enter

    =IFERROR(INT(MATCH(0,INDEX(--(A2:INDEX(A:A,COUNT(A:A))<>A1:INDEX(A:A,COUNT(A:A)-1)),N(IF(1,COUNT(A:A)-ROW(INDIRECT("1:"&COUNT(A:A)-1))))),)/2),INT(COUNT(A:A)/2))

  20. #20
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    Thank You!I wish You the best!

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Count doubles that occur ΑΤ ΤΗΕ SΑΜΕ ΤΙΜΕ

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Formula to count if 2 conditions occur
    By Stufft in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-16-2016, 08:10 AM
  2. [SOLVED] Need the Count of cells only if they occur consecutively
    By bahanley in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-12-2015, 06:09 PM
  3. [SOLVED] Excel 2007 : How to count number of cells doubles?
    By alpha45 in forum Excel General
    Replies: 4
    Last Post: 07-06-2012, 07:34 AM
  4. count doubles
    By newx in forum Excel General
    Replies: 3
    Last Post: 06-17-2012, 06:00 PM
  5. How to use xml to count numbers that occur in roulette
    By SilentShad0w in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-25-2009, 03:49 PM
  6. Count when values occur in different arrays
    By smileyc in forum Excel General
    Replies: 6
    Last Post: 02-26-2009, 07:56 AM
  7. Replies: 6
    Last Post: 02-14-2008, 09:58 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