+ Reply to Thread
Results 1 to 7 of 7

MAC-adress verification

  1. #1
    Registered User
    Join Date
    02-04-2022
    Location
    Sweden
    MS-Off Ver
    Professional Plus 2016
    Posts
    2

    MAC-adress verification

    So Im struggeling to get this right.

    Senario: In cell A1-A10 i need to check its a valid MAC adress.
    Cell must only have Capital letters and letters in the cell can only be A to F and numbers 0 to 9 and it needs to be 12 numbers or letters.

    If the Cell not is valid I need it to turn red.

    AA0032AB3461 Is a valid cell
    AA0032AB34G1 is not a valid cell since it holds a G, This cell I want to be red
    aa0032ab3451 is not valid since the letters are not capital, This cell I want to be red

    Been using =ISNUMBER(SUMPRODUCT(FIND(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),"0123456789ABCDEF")))

    But its not what im looking for.
    Last edited by AliGW; 02-04-2022 at 09:29 AM. Reason: Title changed - please think more carefully about your thread titles in future!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: MAC-adress verification

    In what way is the formula NOT what you are looking for? It seems to work fine on the examples you have given. Can you give some examples where it does NOT work?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: MAC-adress verification

    Is this what you are looking for?

    CF rule for A1:

    =AND(A1<>"",NOT(ISNUMBER(SUMPRODUCT(FIND(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),"0123456789ABCDEF")))))

    Applies to : $A$1:$A$10

    Administrative Note:

    Members will tailor the solutions they offer to the version of Office (Excel) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this. Thanks.
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: MAC-adress verification

    You need an extra condition in there:

    =AND(A2<>"",OR(NOT(LEN(A2)=12),NOT(COUNT(FIND(MID(A2,ROW($1:$12),1),"ABCDEF0123456789"))=12)))

    and FWiW, this also avoids the use of the volatile INDIRECT function.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Registered User
    Join Date
    02-04-2022
    Location
    Sweden
    MS-Off Ver
    Professional Plus 2016
    Posts
    2

    Re: MAC-adress verification

    Thanks, this was exactly what I was looking for!

    AliGW and Glenn: what is the difference between the two?

    now when i get this help can I ask for two more things?

    Can we add all MAC adresses must start with AABB1122 ?
    And can you make sure the same adress is not added 2 times?

    Thanks!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: MAC-adress verification

    This is a new and different question that will require either data validation or possibly VBA.

    Please start a new thread with a suitably descriptive title for this.

    AliGW and Glenn: what is the difference between the two?
    Glenn explained this above.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: MAC-adress verification

    1. Ali's fromula did not exclude NON-12 character strings.

    2. The INDIRECT function recalculates every time anything changes. On small sheets this is not an issue, but if there are lots of them on a big sheet... it will get slow.

+ 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. Adress in Listbox
    By Wijnand1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2018, 09:36 AM
  2. Adress Userform
    By kirana2014 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-28-2016, 12:26 AM
  3. [SOLVED] absolute adress
    By cotix in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-03-2014, 11:27 AM
  4. How to use ActiveCell Adress in variable?
    By Castor77 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-11-2010, 11:28 AM
  5. iqy query from a web adress?
    By ch0ban in forum Excel General
    Replies: 0
    Last Post: 02-03-2010, 05:44 AM
  6. How to adress columns
    By adiman84 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2008, 03:18 AM
  7. [SOLVED] getting the adress on the last row
    By alvin Kuiper in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2006, 12:10 PM

Tags for this Thread

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