Greetings All,
I am trying to create a worksheet to generate batch codes in the form: YMM999, using a single digit for the year, a 2 digit month, and a serial number for the actual batch number. What I would like is to be able to enter the current date, and have the year and month extracted, comparing the month to the month from the previous entry and either increasing the serial counter by one, or resetting it to 1 if the month has changed.
I don't have a problem doing the comparison, padding the serial number portion of the batch number with zeros, or getting it to sequence. I just keep running into a mental block trying to get the year into a form to be compared. I can use =MONTH() to get the 1-12 month value from a date, but I am not getting good years using the =YEAR() function.
I probably have blinders on, but I just don't see a way to get the year out of the date.
I will appreciate any input. Thanks.
Bookmarks