+ Reply to Thread
Results 1 to 9 of 9

Count same last digit numbers and neighbouring numbers

  1. #1
    Forum Contributor
    Join Date
    07-17-2020
    Location
    Uzbek
    MS-Off Ver
    Office 365, V 2212
    Posts
    198

    Count same last digit numbers and neighbouring numbers

    Dear forum members,

    Please I need a formula to count same last digit numbers and neighbouring numbers among 6 different numbers.
    I have attached the sample file for your reference and also as example, I have mentioned the formula which counts same first digit numbers.

    thank you for your help
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Count same last digit numbers and neighbouring numbers

    Okay, is there any difference with last digit between "3+2" and "2+3"? I can easily get a formula that will give "3+2" in row 5 for example but it could just as easily give "2+3" as it doesn't sort by size. :/
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Count same last digit numbers and neighbouring numbers

    In H4 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In O4 (and for a similar pattern in all homogeneous numbers, i.e. 4, 33, 111)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In O5 (for no matches)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In O8 (and similar patterns where there are different permutations)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I haven't worked on the neighboring numbers yet.

  4. #4
    Forum Contributor
    Join Date
    07-17-2020
    Location
    Uzbek
    MS-Off Ver
    Office 365, V 2212
    Posts
    198

    Re: Count same last digit numbers and neighbouring numbers

    Thanks ChemistB for the support.

    Can you please check the result of H34, it should be 22 but the result is showing 222. please advise.

    thanks
    Last edited by AliGW; 07-17-2020 at 12:09 PM. Reason: Please don't quote unnecessarily!

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Count same last digit numbers and neighbouring numbers

    oops, I accidentally put
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    into the formula twice. Remove it either from the beginning or end.

  6. #6
    Forum Contributor
    Join Date
    07-17-2020
    Location
    Uzbek
    MS-Off Ver
    Office 365, V 2212
    Posts
    198

    Re: Count same last digit numbers and neighbouring numbers

    Quote Originally Posted by ChemistB View Post
    oops, I accidentally put
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    into the formula twice. Remove it either from the beginning or end.
    Thanks a lot ChemistB, now calculating excellent,

    Any chance to modify below the formula for counting neighbouring numbers as per the attachment's requirement please;

    ({=IFERROR(1/(1/MAX(FREQUENCY(IF((A4:E4+1)=B4:F4,COLUMN(A4:E4)),IF((A4:E4+1)<>B4:F4,COLUMN(A4:E4)))))+1,0)}

    thanks

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: Count same last digit numbers and neighbouring numbers

    Try the following array entered formula**:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  8. #8
    Forum Contributor
    Join Date
    07-17-2020
    Location
    Uzbek
    MS-Off Ver
    Office 365, V 2212
    Posts
    198

    Re: Count same last digit numbers and neighbouring numbers

    Quote Originally Posted by JeteMc View Post
    Try the following array entered formula**:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Let us know if you have any questions.
    Thanks a lot JeteMc, as expected it's working perfectly

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: Count same last digit numbers and neighbouring numbers

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Replies: 1
    Last Post: 04-18-2019, 01:35 AM
  2. [SOLVED] Macro to convert WBS single digit numbers to double digit numbers
    By LeanAccountant in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 06-09-2018, 05:25 AM
  3. [SOLVED] Formula for getting the digit count between two numbers?
    By mix_mash in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-01-2017, 06:11 PM
  4. [SOLVED] Need to count only 6 digit numbers
    By Sekars in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-02-2017, 10:47 AM
  5. Extract 4 digit common numbers from 5 digit numbers
    By ameque in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-24-2013, 01:09 AM
  6. [SOLVED] macro to extract 9 digit numbers as well as alpha numberic 9 digit numbers from txt file
    By Raju Radhakrishnan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2012, 10:15 AM
  7. To count numbers with 4 digit/5 digit with given Range.
    By ebin charles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2012, 08:49 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