I perfrom semi-manual excel manipulations really frequently and although it takes me maybe 15 minutes each time to manipulate a list into what I need, I know that the repeated functions I do can be done with a macro with the click of a button. Unfortunately I am not familiar with VBA.
I have a spreadsheet of document numbers and their revisions (columns A and B). The document numbers are repeated if there are multiple revisions of the same document. There are also additional columns with important information such as author, etc. and I need to maintain this data.
I need to generate a unique list of documents and display their latest revision only.
There is one caveat, the revisions are alpha and numeric. 'Alpha' revisions are anywhere from A to G (or higher) and are considered preliminary before they go to numeric revisions which are 0-99. so all alpha values are considered less than 0.
For example, the list I start with could look like this:
AAA-020 - A
AAA-020 - 0
BBB-010 - 0
BBB-010 - 1
AAA-020 - B
CCC-010 - B
CCC-010 - A
BBB-010 - 2
And I would want the final list to be
AAA-020 - 0
BBB-010 - 2
CCC-010 - B
And I also need to include the additional columns on the spreadsheet corresponding to the latest revision.
I have been following these steps to make this happen:
- Insert 3 columns to the right of column B
- Because my actual highest alpha revision is 'G', I assign A to -7, B to -6, and so on with this formula in the newly created column C : =IF(B2="A",-7,IF(B2="B",-6,IF(B2="C",-5,IF(B2="D",-4,IF(B2="E",-3,IF(B2="F",-2,IF(B2="G",-1,B2)))))))
- The list I am dealing with is generated by another program which stores numbers as text, so I then highlight column B and go to Data-Text to columns and click through the screens to convert them to actual numbers
- Then I sort the list by column A and then by column C to get the documents in order sorted by revision (so that the latest revision appears at the bottom of the list).
- Then I paste this formula into column D to identify highest revision: =IF(A2=A3,0,1)
- I copy column D and use paste special to paste only the values from column D into column E
- And then I sort by column E and delete all of the rows that have a zero in column E and walla!
Is there an easier way? I'm hoping someone can point me in the right direction.
Thanks so much,
Emily
Bookmarks