+ Reply to Thread
Results 1 to 8 of 8

Checking code format is correct or not ?

  1. #1
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,695

    Checking code format is correct or not ?

    I have codes on cell a1 that look as 100.000.01

    I need a formula to cell b1 that will identify any
    code that is not in this format e.g. 100.0000.01

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Checking code format is correct or not ?

    try
    =AND(SUMPRODUCT((IFERROR(FIND(".",MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),0))*ROW(INDIRECT("1:"&LEN(A1))))=12,LEN(A1)=10)

    array entered!
    Last edited by hemesh; 05-10-2014 at 05:22 AM.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Checking code format is correct or not ?

    Another way around....

    Assuming that you have 100.000.01 in A1, then in B1 try this.....

    Please Login or Register  to view this content.
    Last edited by sktneer; 05-10-2014 at 05:57 AM.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Checking code format is correct or not ?

    Quote Originally Posted by makinmomb View Post
    I have codes on cell a1 that look as 100.000.01

    I need a formula to cell b1 that will identify any
    code that is not in this format e.g. 100.0000.01
    Hi.

    What do you mean precisely by "this format"? You mean that it should always be:

    3 numbers, a dot, 3 numbers, a dot, 2 numbers?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Checking code format is correct or not ?

    Quote Originally Posted by sktneer View Post
    Another way around....

    Assuming that you have 100.000.01 in A1, then in B1 try this.....

    Please Login or Register  to view this content.
    I think to check length is necessary as user may add more numbers after second "." entry

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Checking code format is correct or not ?

    @hemesh

    Thanks for the pointing this out. I have edited the formula.

  7. #7
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,695

    Re: Checking code format is correct or not ?

    3 numbers, a dot, 3 numbers, a dot, 2 numbers?

    Yes always in this format

    Thanks Hemesh , I chose to take that of Sktneer since it is non array ,
    While I have collected your array into my collection

  8. #8
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Checking code format is correct or not ?

    That's good to here !
    Below is the non array solution for Your COLLECTION
    =AND(SUMPRODUCT(--(ISNUMBER(FIND(".",MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))))*ROW(INDIRECT("1:"&LEN(A1))))=12,LEN(A1)=10)

+ 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] Check cells are correct format and contain correct data
    By rikosborne in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2014, 02:53 PM
  2. [SOLVED] Calculating GST and Checking that the GST is correct
    By becca26031993 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-05-2012, 11:34 PM
  3. Fix Needed for Code to Send Correct Data to Correct Sheets
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-04-2012, 03:53 PM
  4. Replies: 1
    Last Post: 06-01-2008, 09:00 AM
  5. [SOLVED] Checking if a cell entry is correct before adding it to another
    By Zakynthos in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 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