+ Reply to Thread
Results 1 to 7 of 7

incorrectly formatted reference number

  1. #1
    Registered User
    Join Date
    10-26-2012
    Location
    Gatineau, Qc, Canada
    MS-Off Ver
    Excel 2007 (Or Anything)
    Posts
    43

    incorrectly formatted reference number

    Good day,

    I have been trying to get this verification done by formula and than highlighting the values but cannot seem to find how since my formulas do not work at all. Maybe somebody can explain to me what I am doing wrong when providing an answer?

    C-2019-2020-Q2-00001
    C-2019-2020-Q2-00002
    C-2019-2020-Q2-00003

    Please Login or Register  to view this content.
    B50ZM-000001/001/BD
    B50ZM-000001/001/BD
    B50ZM-000001/002/BD

    Please Login or Register  to view this content.
    For your expertise,

    many thanks
    Last edited by bassinator; 09-26-2019 at 01:55 PM.
    bassinator

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: incorrectly formatted reference number

    Ignore this reply, I'm not thinking straight...
    Last edited by Special-K; 09-25-2019 at 10:48 AM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: incorrectly formatted reference number

    May be...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    But note that ? will accept any character in this case (alphabet or numeric). So you may want additional checks.

    Personally, I think it's easier to use VBA and RegExp pattern matching.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: incorrectly formatted reference number

    I thought ? first of all but it didnt seem to work with my test values.

    Maybe this for the first one?

    =AND(LEFT(B2,1)>="A",LEFT(B2,1)<="Z",MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2,"0","9"),"1","9"),"2","9"),"4","9"),"5","9"),"6","9"),"7","9"),"8","9"),2,99)="-9999-9999-Q9-99999")

    This checks for
    first character alphabetic
    and converts all digits to 9

    though this would allow for Q5-Q9 which are presumably quarters, in which case you'll need an additional condition based on the first alphabetic check but to check for the range 1-4 for the quarters AND(MID(B2,13,1)>="1",MID(B2,13,1)<="4")

  5. #5
    Registered User
    Join Date
    10-26-2012
    Location
    Gatineau, Qc, Canada
    MS-Off Ver
    Excel 2007 (Or Anything)
    Posts
    43

    Re: incorrectly formatted reference number

    Thank you folks, and yes VB is always better but I have a colleague who prefers formulas so I have both of them done.

    Here's what came out of this post that worked.
    Please Login or Register  to view this content.
    thx again

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: incorrectly formatted reference number

    You are welcome and thanks for sharing your solution

  7. #7
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: incorrectly formatted reference number

    Quote Originally Posted by bassinator View Post
    Thank you folks, and yes VB is always better but I have a colleague who prefers formulas so I have both of them done.

    Here's what came out of this post that worked.
    Please Login or Register  to view this content.
    thx again
    This wont work if they put:

    alphanumeric in the year, e.g. C-2a19-2020-Q2-00001 or C-2019-202a-Q2-00001 or
    alphanumeric in the last 5 digits, e.g. 'C-2019-2020-Q2-00b01

    These values all result in "ok" though they are all an incorrectly formatted reference number

+ 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. Vlookup source data formatted incorrectly?
    By crmadden in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-16-2017, 07:17 PM
  2. [SOLVED] Filter & remove incorrectly formatted mobile numbers
    By garryhope86 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-07-2015, 09:27 PM
  3. Reference formatted areas from different workbooks
    By Rasmus_ep in forum Excel General
    Replies: 0
    Last Post: 01-16-2015, 05:22 AM
  4. [SOLVED] How to reference a conditionally formatted cell(s)
    By EXCELNEWCOMER in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-22-2013, 04:34 AM
  5. [SOLVED] How to reference a Conditional Formatted Cell ?
    By EXCELNEWCOMER in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-20-2013, 04:54 AM
  6. Incorrectly passing reference to ToggleButton
    By e.good in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-27-2011, 10:16 PM
  7. Incorrectly formatted numbers
    By mikecook in forum Excel General
    Replies: 3
    Last Post: 06-02-2010, 08:37 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