+ Reply to Thread
Results 1 to 8 of 8

Checking code format is correct or not ?

Hybrid View

  1. #1
    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.....

    =IF(AND(LEN(A1)=10,FIND(".",A1)+FIND(".",SUBSTITUTE(A1,".","^",1))=12),"Correct Format","Incorrect Format")
    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.

  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 ?

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

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

    =IF(FIND(".",A1)+FIND(".",SUBSTITUTE(A1,".","^",1))=12,"Correct Format","Incorrect Format")
    I think to check length is necessary as user may add more numbers after second "." entry
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    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

+ 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