Formula to lookup the last digit and second to last digit in VIN number

Copper Contributor

I have a fleet of 600 pieces of equipment. I need to perform a look up that looks at the last digit in the VIN and then another lookup for the 2nd to last digit. For example:  VIN # 123456789 - I need to have a formula to determine if last digit is an even or odd and then another formula to determine if second to last digit is even or odd.  Can anyone help?  Thank you

2 Replies

@clambert70 

Let's say you have a VIN in D2.

Enter the following formula in E2:

 

=ISEVEN(E2)

 

This will return TRUE if the last digit is even, FALSE if it is odd.

 

Enter the following formula in F2:

 

=ISEVEN(QUOTIENT(D3,10))

 

This will return TRUE if the next-to-last digit is even, FALSE if it is odd.

@clambert70 

 

Assuming VINs are entered as text, something like this should meet your need. There are always multiple ways to use Excel to resolve situations, however, and I'm sure this is no exception. The heart of the matter, though, is in realizing you can identify the last and next to last, using the RIGHT and LEFT functions, and then the ISODD and ISEVEN functions answer the question of the nature of those digits. How you choose to put it all together, whether or not you make use of IF or IFS---all that's up to you.

mathetes_0-1603812332939.png