Excel Analytics and Programming - Assignment 2: ND ND
Excel Analytics and Programming - Assignment 2: ND ND
At a fair, the participants were asked to list their favorite music groups. Afterwards, all of the responses were typed up onto column A in an Excel worksheet. Participants may have used different cases of letters or added spaces between the words, but they refer to same entry. For example, the following entries should all be treated the same: Coldplay, ColdPlay, Cold play, c o Ld p lAy Write the codes in VBA that will create a sorted tally table that displays the distinct entries with their count in the dataset. When numerous formats of the same entry appear, any variety of it can appear in the tallied table. Make sure that the entire text in column A will be displayed. The table to the left is an example of the original data inputted. The table to the right is the corresponding desired output.
Some potentially useful string functions: Concatenation & Length To join Hi and class with a space between: hi & & class Len(hello) will return 5 Find InStr("abcdefg", "cd") returns the index at which cd first appears, which is 3 InStr("abcdefg", "x") returns 0 as x is not found in the string InStr(3, "ababcd", "b") finds the index of the first instance of b starting at index 3, which is 4 Split Mid("ABCDEF", 2) returns the substring from the 2nd entry until the end, which is BCDEF Mid("ABCDEF", 2, 3) returns the substring from the 2nd entry, of length 3, which is BCD Left("abcdefg", 4) returns the first 4 characters of the string, which is abcd Right("abcdefg", 4) returns the last 4 characters of the string, which is defg Trim(abc ) gets rid of the extra spaces at the end and returns abc