+ Reply to Thread
Results 1 to 12 of 12

How to check digits of a number

Hybrid View

kakero How to check digits of a... 10-22-2020, 10:52 AM
Norie Re: How to check digits of a... 10-22-2020, 10:53 AM
kakero Re: How to check digits of a... 10-22-2020, 10:55 AM
mikeava Re: How to check digits of a... 10-22-2020, 12:21 PM
kakero Re: How to check digits of a... 10-22-2020, 12:28 PM
mikeava Re: How to check digits of a... 10-23-2020, 07:03 PM
mikeava Re: How to check digits of a... 10-23-2020, 07:42 PM
kakero Re: How to check digits of a... 10-25-2020, 03:46 AM
bebo021999 Re: How to check digits of a... 10-23-2020, 09:48 PM
hrlngrv Re: How to check digits of a... 10-25-2020, 04:28 AM
GeoffW283 Re: How to check digits of a... 10-23-2020, 11:44 PM
kakero Re: How to check digits of a... 10-25-2020, 03:47 AM
  1. #1
    Registered User
    Join Date
    04-28-2020
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    27

    How to check digits of a number

    Hi

    I want to define a rule for a data validation . I wan to force user to enter a number that its digit are in increasing order
    first digit < second digit< third digit <.........

    and also without any duplicate

    length of number varies between 1 to 8 digit
    All digit will be in ONE CELL



    Any suggestion ?

    Thank you
    Attached Images Attached Images
    Last edited by kakero; 10-22-2020 at 12:35 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: How to check digits of a number

    Is it always 3 digits?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    04-28-2020
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    27

    Re: How to check digits of a number

    Hi. 1 to 8 digits . not always 3

  4. #4
    Valued Forum Contributor
    Join Date
    04-24-2020
    Location
    Woodbridge, VA
    MS-Off Ver
    2016
    Posts
    434

    Re: How to check digits of a number

    All in different cells?

  5. #5
    Registered User
    Join Date
    04-28-2020
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    27

    Re: How to check digits of a number

    No - All digits will be in only ONE CELL

  6. #6
    Valued Forum Contributor
    Join Date
    04-24-2020
    Location
    Woodbridge, VA
    MS-Off Ver
    2016
    Posts
    434

    Re: How to check digits of a number

    OK - I finally figured it out. Since it wasn't certain how many digits the user was going to put in, made things interesting to say the least. So I had to figure separate formulas if it was 3 digits, or 4, etc. That is what is in Columns R - W.

    Your result is in Column C (which points to R - W depending on the number of digits).

    I copied the formula down to row 20. You can just keep copying down if you need more. If nothing is in the cell it will be blank.

    Let me know if you have any questions.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    04-24-2020
    Location
    Woodbridge, VA
    MS-Off Ver
    2016
    Posts
    434

    Re: How to check digits of a number

    Forgot to check for 2 digits.
    See updated file. Please let me know if you have any questions.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-28-2020
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    27

    Re: How to check digits of a number

    Thank you very much

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,651

    Re: How to check digits of a number

    With number in A1

    This returns TRUE/FALSE, use it for conditional formatting

    =AND(MID(A1,ROW(INDIRECT("2:"&LEN(A1))),1)-MID(A1,ROW(INDIRECT("1:"&LEN(A1)-1)),1)>0)
    Array formula, confirmed with Ctrl-shift-enter
    Quang PT

  10. #10
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: How to check digits of a number

    Quote Originally Posted by bebo021999 View Post
    . . .
    =AND(MID(A1,ROW(INDIRECT("2:"&LEN(A1))),1)-MID(A1,ROW(INDIRECT("1:"&LEN(A1)-1)),1)>0)
    Would return an error when A1 has just 1 numeral, in which case INDIRECT("1:"&0) would be the cause.

  11. #11
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: How to check digits of a number

    Another way:

    Number in A1, returns true or false. Regular non-array formula entry.

    Formula: copy to clipboard
    =SUM(--(MID(A1&"A"&REPT("A", 9-LEN(A1)), {1,2,3,4,5,6,7,8}, 1) < MID(A1&"A"&REPT("A", 9-LEN(A1)), {2,3,4,5,6,7,8,9}, 1))) =LEN(A1)
    Geoff

    Did I help significantly? If you wish, click on * Add Reputation to say thanks.
    If your problem has been resolved please select ?Solved? from the Thread Tools menu

  12. #12
    Registered User
    Join Date
    04-28-2020
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    27

    Re: How to check digits of a number

    Quote Originally Posted by GeoffW283 View Post
    Another way:

    Number in A1, returns true or false. Regular non-array formula entry.

    Formula: copy to clipboard
    =SUM(--(MID(A1&"A"&REPT("A", 9-LEN(A1)), {1,2,3,4,5,6,7,8}, 1) < MID(A1&"A"&REPT("A", 9-LEN(A1)), {2,3,4,5,6,7,8,9}, 1))) =LEN(A1)
    Thank you very much

+ 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 number of unique X digits duplicate pairs from a number
    By SedoSan7 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-19-2019, 04:03 AM
  2. How to ID digits within a group of 8-digits that equal a specified number
    By Thunder001 in forum Excel Formulas & Functions
    Replies: 31
    Last Post: 07-04-2019, 02:49 AM
  3. [SOLVED] VBA Filter Out Unique Digits Permutation via Check Box Mark
    By AndyJr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2018, 12:47 AM
  4. Check most frequent number in 1 column that has 4 digits number
    By Merson78 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-07-2014, 10:57 PM
  5. Replies: 5
    Last Post: 12-08-2008, 11:47 AM
  6. Check digits between column
    By iamrony in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2008, 11:24 PM
  7. ISBN Check Digits
    By Colin Vicary in forum Excel General
    Replies: 3
    Last Post: 08-12-2005, 12:05 PM

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