+ Reply to Thread
Results 1 to 12 of 12

Need to count only 6 digit numbers

  1. #1
    Forum Contributor
    Join Date
    02-15-2016
    Location
    India
    MS-Off Ver
    2016
    Posts
    657

    Need to count only 6 digit numbers

    Hello Friends

    In the column A need to count only 6 digit numbers by formula, here duplicate will not come for 6 digit number.
    Attached Files Attached Files
    Sekar

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Need to count only 6 digit numbers

    Try

    =SUM(--(LEN(A1:A73)=6)) Ctl Shift Enter

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need to count only 6 digit numbers

    with your example

    try =SUM(COUNT(A1:A73,ISNUMBER(A1:A73))) array entered
    or
    simply COUNT()
    Last edited by sandy666; 06-02-2017 at 10:02 AM.

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

    Re: Need to count only 6 digit numbers

    or
    =SUMPRODUCT(--(LEN(A1:A200)=6))
    (don't need CNTRL SHFT ENTER)

    taking into account that the 6 characters might not be a number (thanks Sandy)

    =SUMPRODUCT(--(LEN(A1:A200)=6),--(ISNUMBER(A1:A200)))
    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

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Need to count only 6 digit numbers

    With your data, you can just use...
    =COUNT(A1:A73)

    By default, COUNT function ignores texts.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need to count only 6 digit numbers

    I re-read post#1 and agree with ChemistB in post #4 : no array, 6 digits, numbers only
    Last edited by sandy666; 06-02-2017 at 10:07 AM. Reason: typo

  7. #7
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Need to count only 6 digit numbers

    I re-read post#1 and agree with ChemistB in post #4
    I'll second that, ChemistB's formula is the more robust method (when there could be numeric value with more/less than 6 char).

    Another way to write the same formula. "*" multiplication serves to force result into number.
    =SUMPRODUCT(ISNUMBER(A1:A73)*(LEN(A1:A73)=6))

  8. #8
    Forum Contributor
    Join Date
    02-15-2016
    Location
    India
    MS-Off Ver
    2016
    Posts
    657

    Re: Need to count only 6 digit numbers

    Hello 63falcondude, sandy, ChemistB, CK76

    Thanks for all of your formulas. All formulas working well, my datas are being added and even if i changed 73 to 200 it is working fine.

    Simple count formula cannot be used, since it is simply counting irrespective of digits (here it is 6).

    thanks again.

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need to count only 6 digit numbers

    So example was inconcistent

    but if any of solution works for you that's good.

    You are welcome and thanks for the feedback

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

    Re: Need to count only 6 digit numbers

    Quote Originally Posted by CK76 View Post
    Another way to write the same formula. "*" multiplication serves to force result into number.
    =SUMPRODUCT(ISNUMBER(A1:A73)*(LEN(A1:A73)=6))
    True, some people prefer using multiplication instead of "--" Either will force a number. I prefer using commas because, in the cases where you are summing a column (not this case), text will result in an error with multiplication.
    "

  11. #11
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Need to count only 6 digit numbers

    Quote Originally Posted by Sekars View Post
    Hello 63falcondude, sandy, ChemistB, CK76

    Thanks for all of your formulas. All formulas working well...thanks again.
    Glad we could help. Thanks for the rep!
    Last edited by 63falcondude; 06-02-2017 at 10:52 AM.

  12. #12
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need to count only 6 digit numbers

    Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding

    For normal conversational replies, try using the QUICK REPLY box below.

+ 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] Extract each digit from 3 Digit Numbers and put in other cells?
    By Brian.Aerojet in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 05-21-2017, 08:20 PM
  2. Macro to identify 3-digit and 4-digit numbers as valid dates
    By gojakie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2015, 08:16 AM
  3. [SOLVED] Breakdown 4 digit numbers into 2 digit-numbers
    By Jerry HKA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2014, 10:20 AM
  4. 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
  5. Replace all one-digit number with two-digit numbers
    By sandykunaish in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-20-2013, 09:56 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