+ Reply to Thread
Results 1 to 23 of 23

Vehicle (VIN) calculation

  1. #1
    Registered User
    Join Date
    02-13-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Vehicle (VIN) calculation

    I am trying to create a calculation in Excel for a vehicles VIN number.

    The VIN is 17 characters long

    3VW - FE21C - 0 - 4 - M - 000001

    I need a calculation that tells me whether it is a valid VIN from the details I input.

    The criteria is
    1. The letters I, O and Q are not to be used anywhere in the VIN.
    2. Position 9 of the VIN can be only the values 0,1,2,3,4,5,6,7,8,9 and X
    3.The last five values of the VIN should always be numeric.
    4. Position 10 of the VIN should always be a letter except years 2001 to 2009
    5. Position 10 of the VIN cannot be U or Z.

    I have tried it a few times but always seem to get stuck. If anyone has better knowledge than me then please help.

    I have attached a sheet about VINS

    Thanks.

    M
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vehicle (VIN) calculation

    The VIN is 17 characters long? i make it
    22 (without spaces or more if spaces included)
    3VW-FE21C-0-4-M-000001
    is this all in one cell?
    and post an excel not pdf example! oh i see the pdf is the rules
    but what happens in 2011? to the year identifier position 10?
    also position 10 cannot be an u or a z also it looks like i or o either
    edit i see i/o covered in rule 1
    Last edited by martindwilson; 02-13-2011 at 11:46 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Contributor TechRetard's Avatar
    Join Date
    06-14-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Vehicle (VIN) calculation

    can you work with this where vin is in A1 and year is in B1?

    Please Login or Register  to view this content.
    Last edited by TechRetard; 02-13-2011 at 11:39 AM.

  4. #4
    Registered User
    Join Date
    02-13-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Vehicle (VIN) calculation

    Quote Originally Posted by TechRetard View Post
    can you work with this where vin is in A1 and year is in B1?

    Please Login or Register  to view this content.
    Can you explain by Year in B1

    If i just enter the VIN in A1 then I dont why I need B1. Could you kindly explain.

    Thanks

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vehicle (VIN) calculation

    you should know the year the vehicle is supposed to be so you can check the vin? otherwise you are just checking its a valid construct or you could just make one up that meets the criteria vins are a little more complicated than the pdf shows http://en.wikipedia.org/wiki/Vehicle...ication_Number
    Last edited by martindwilson; 02-13-2011 at 04:56 PM.

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,445

    Re: Vehicle (VIN) calculation

    Hi,

    I can't get my head around such long formulas, so I needed to break it up into smaller pieces.

    See if the attached helps, where each test shows an answer. Hope this helps.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  7. #7
    Forum Contributor TechRetard's Avatar
    Join Date
    06-14-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Vehicle (VIN) calculation

    Quote Originally Posted by sinternational View Post
    Can you explain by Year in B1

    If i just enter the VIN in A1 then I dont why I need B1. Could you kindly explain.

    Thanks
    Well the PDF you provided says that "Position 10 of the VIN should always be a letter except for model years 2001 to 2009"....how would the formula know what year your VIN is for if you don't tell it? Hence you need to supply the year so it knows whether position 10 should be a number or letter

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vehicle (VIN) calculation

    the 9th character that constitutes the check sum than also needs to be checked against the whole thing!

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,792

    Re: Vehicle (VIN) calculation

    This formula will check the following

    VIN has 17 characters
    none of those characters are I, O or Q
    last 6 characters are numeric
    character 10 isn't U or Z

    =AND(LEN(A2)=17,ISNUMBER(RIGHT(A2,6)+0),SUM(LEN(SUBSTITUTE(A2,{"I","O","Q"},"")))=51,AND(MID(A2,10,1)<>{"U","Z"}))

    Assuming VIN in A2. Formula returns TRUE or FALSE

    As Martin says, you also need to check that the "check digit" at character 9 is valid given the rest of the VIN

    This formula will do that part only

    =SUBSTITUTE(MOD(SUM(IF(ISNUMBER(MID(A2,ROW(INDIRECT("1:17")),1)+0), MID(A2,ROW(INDIRECT("1:17")),1)+0, MOD(CODE(MID(A2,ROW(INDIRECT("1:17")),1))-2,9)+1+(CODE(MID(A2,ROW(INDIRECT("1:17")),1))>82))*{8;7;6;5;4;3;2;10;0;9;8;7;6;5;4;3;2}),11),10,"X")&""=MID(A2,9,1)

    Needs to be confirmed with CTRL+SHIFT+ENTER
    Last edited by daddylonglegs; 02-13-2011 at 05:47 PM.
    Audere est facere

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,792

    Re: Vehicle (VIN) calculation

    Just to refine this a little....

    I believe that character 10 also can't be a zero......and I can shorten the part that ensures letters I, O and Q don't appear, so that part of the check can be

    =AND(LEN(A2)=17,ISNUMBER(RIGHT(A2,6)+0),COUNT(SEARCH({"I","O","Q"},A2))=0,AND(MID(A2,10,1 )<>{"U","Z",0}))

    also to shorten the check digit part you can use a table with the various codes and shorten formula to the following

    =SUBSTITUTE(MOD(SUMPRODUCT(LOOKUP(MID(A2,ROW(INDIRECT("1:17")),1),Vincheck), Multi),11),10,"X")&""=MID(A2,9,1)

    where Vincheck is a two column table that converts letters/digits to numbers and Multi is a column containing the weights.

    Then if you want to you can combine these in one "mega-formula", i.e.

    =AND(LEN(A2)=17,ISNUMBER(RIGHT(A2,6)+0),COUNT(SEARCH({"I","O","Q"},A2))=0,AND(MID(A2,10,1 )<>{"U","Z",0}),SUBSTITUTE(MOD(SUMPRODUCT(LOOKUP(MID(A2,ROW(INDIRECT("1:17")),1),Vincheck),Multi),11),10,"X")&""=MID(A2,9,1))

    in all cases TRUE means it's valid, see attached
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    02-13-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Vehicle (VIN) calculation

    Thanks for that.
    I have checked 5 VINs and they all show true.

    Appreciated.

  12. #12
    Registered User
    Join Date
    05-20-2016
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    1

    Re: Vehicle (VIN) calculation

    Trying to use your formula in a spreadsheet, and it works beautifully. I'm hung up on a couple though, like this VIN: 3LG6L2GK5ER823594. It passes with your first half of the formula, but not the 2nd. I don't know if it is somehow connected to the VinCheck table, or if I need to incorporate that into my new worksheet. I'm trying to figure out what is wrong with this VIN. Thoughts?

  13. #13
    Registered User
    Join Date
    10-31-2016
    Location
    Ghana
    MS-Off Ver
    Microsoft Office Word 2007
    Posts
    2

    Re: Vehicle (VIN) calculation

    Hello All,

    I will need assistance in creating the perfect vin check excel sheet for my day to day activities.. looking at the forum and all answers to the thread are impeccable. knowing little I will oblige with the experts to help me in dealing with this.
    attaching an excel for your perusal and a vin (chassis) for further process.. awaiting your response.

    thank you.

  14. #14
    Registered User
    Join Date
    10-31-2016
    Location
    Ghana
    MS-Off Ver
    Microsoft Office Word 2007
    Posts
    2

    Re: Vehicle (VIN) calculation

    Hello help here I can't seem to attach my file.

    any help please

  15. #15
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,993

    Re: Vehicle (VIN) calculation

    crisslybell,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ben Van Johnson

  16. #16
    Registered User
    Join Date
    03-24-2017
    Location
    tyrew
    MS-Off Ver
    rthgfedwsq
    Posts
    1

    Re: Vehicle (VIN) calculation

    Thanks a lot LongLegs, works perfect !

  17. #17
    Registered User
    Join Date
    06-29-2017
    Location
    United States
    MS-Off Ver
    2016
    Posts
    27

    Re: Vehicle (VIN) calculation

    Quote Originally Posted by daddylonglegs View Post
    Just to refine this a little....

    I believe that character 10 also can't be a zero......and I can shorten the part that ensures letters I, O and Q don't appear, so that part of the check can be

    =AND(LEN(A2)=17,ISNUMBER(RIGHT(A2,6)+0),COUNT(SEARCH({"I","O","Q"},A2))=0,AND(MID(A2,10,1 )<>{"U","Z",0}))

    also to shorten the check digit part you can use a table with the various codes and shorten formula to the following

    =SUBSTITUTE(MOD(SUMPRODUCT(LOOKUP(MID(A2,ROW(INDIRECT("1:17")),1),Vincheck), Multi),11),10,"X")&""=MID(A2,9,1)

    where Vincheck is a two column table that converts letters/digits to numbers and Multi is a column containing the weights.

    Then if you want to you can combine these in one "mega-formula", i.e.

    =AND(LEN(A2)=17,ISNUMBER(RIGHT(A2,6)+0),COUNT(SEARCH({"I","O","Q"},A2))=0,AND(MID(A2,10,1 )<>{"U","Z",0}),SUBSTITUTE(MOD(SUMPRODUCT(LOOKUP(MID(A2,ROW(INDIRECT("1:17")),1),Vincheck),Multi),11),10,"X")&""=MID(A2,9,1))

    in all cases TRUE means it's valid, see attached
    Sorry to reply with such a long quote, but this was an old thread so I wanted to be specific... Why would I get N/A for the Vincheck and Multi formulas when I renamed the cells as such and changed the cell from A2 to C4?? To be clear, when I enter the formula, the i get "N/A" with the explanation being "A value is not available to the formula or function"

    THanks!

  18. #18
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,993

    Re: Vehicle (VIN) calculation

    thestatechamp,
    1. Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

    2. Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding

    For normal conversational replies, try using the QUICK REPLY box below.

  19. #19
    Registered User
    Join Date
    06-26-2018
    Location
    Colorado Springs, Colorado
    MS-Off Ver
    10
    Posts
    6

    Re: Vehicle (VIN) calculation

    Hello All,

    New to this forum, and boy am I happy I stumbled across all you fine folks here! I too am in need of an excel spreadsheet for VIN numbers. I'm terrible at math and wondering how I would go about making a formula in excel to get the check digit for the 9th position?! Any suggestions would be greatly appreciated.
    Thank you all in advance,
    Ashley

  20. #20
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Vehicle (VIN) calculation

    Irishmcclainish welcome to the forum, Im glad you stumbled

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

    (ssshhh...take a look at the SEARCH() function)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  21. #21
    Registered User
    Join Date
    03-28-2020
    Location
    algiers
    MS-Off Ver
    2013
    Posts
    1

    Re: Vehicle (VIN) calculation

    last five chars should be digits
    the formula become:
    =ET(NBCAR(Z2)=17;ESTNUM(DROITE(Z2;5)+0);NB(CHERCHE({"I"."O"."Q"};Z2))=0;ET(STXT(Z2;10;1 )<>{"U"."Z".0}))

  22. #22
    Registered User
    Join Date
    03-23-2022
    Location
    United States
    MS-Off Ver
    2013
    Posts
    2

    Re: Vehicle (VIN) calculation

    I'm looking to make the same tool as yours but I don't have enough data on VIN. Can you give me the data you have, please?

  23. #23
    Registered User
    Join Date
    03-23-2022
    Location
    United States
    MS-Off Ver
    2013
    Posts
    2

    Re: Vehicle (VIN) calculation

    Quote Originally Posted by sinternational View Post
    I am trying to create a calculation in Excel for a vehicles VIN number.

    The VIN is 17 characters long

    3VW - FE21C - 0 - 4 - M - 000001

    I need a calculation that tells me whether it is a valid VIN from the details I input.

    The criteria is
    1. The letters I, O and Q are not to be used anywhere in the VIN.
    2. Position 9 of the VIN can be only the values 0,1,2,3,4,5,6,7,8,9 and X
    3.The last five values of the VIN should always be numeric.
    4. Position 10 of the VIN should always be a letter except years 2001 to 2009
    5. Position 10 of the VIN cannot be U or Z.

    I have tried it a few times but always seem to get stuck. If anyone has better knowledge than me then please help.

    I have attached a sheet about VINS

    Thanks.

    M
    I'm looking to make the same tool as yours but I don't have enough data on VIN. Can you give me the data you have, please?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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