I have a list of values in column A that represent dates. They are in the format YYMMDD. For example, march 31st 2007 is recorded in its cell as 070331.
I have another spreadsheet with two cells where the user enters a year and a quarter. Quarter 1 represent Jan 1 - Mar 31, Quarter 2 represents Apr 1 to Jun 30, and so on.
Currently my code grabs the user defined year and quarter and converts it to the corresponding date. For example: if the user enters 07 as the year and quarter 3, two variables get defined (startDate = 7/1/07, endDate = 9/30/07).
Now is where everything I have gets into a huge mess of if statements. As you can see, the values I am trying to find (format YYMMDD) based off of the startDate and endDate are not in the same format. Currently my mess of if statements break apart the startDate and endDate variables and reassemble them to mirror the format YYMMDD. However, I run into issues when there is a leading zero in a month or day. I have temporarly gotten around this by just throwing more if statements at my code, but it is getting extremely difficult to read and modify.
My question is this:
Is there a simple way I can convert the format MM/DD/YY to YYMMDD without the method that I am using above? I figured it would be fun to attempt this conversion using logic. Its not fun.
Bookmarks