I need to convert my long excel table into a wide table as shown in the image.
I already has some access doing this in R and Tableau Prep, however I want all the empty/blank cells to be at the end of each category. Not at the top. Excel VBA may be my best option. However I am not familiar with VBA.
My code in R to get a wide table: data_wide <- spread(dataset, Sector, "Description(Unique)")
However with this, I don't get the blank cells at the end.
HEre is my dataset for R:
structure(list(Number = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26),
Theme = c("Summer", "Summer", "Summer", "Summer", "Summer",
"Summer", "Summer", "Summer", "Summer", "Summer", "Summer",
"Summer", "Summer", "Summer", "Winter", "Winter", "Winter",
"Winter", "Winter", "Winter", "Fall", "Fall", "Fall", "Fall",
"Fall", "Fall"), Description = c("A", "B", "C", "D", "E",
"F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q",
"R", "S", "T", "U", "V", "W", "X", "Y", "Z"), Sector = c("APPLE",
"APPLE", "APPLE", "ORANGE", "ORANGE", "ORANGE", "ORANGE",
"ORANGE", "BANANA", "BANANA", "CHERRY", "CHERRY", "CHERRY",
"APPLE", "APPLE", "ORANGE", "BANANA", "CHERRY", "CHERRY",
"APPLE", "APPLE", "ORANGE", "ORANGE", "ORANGE", "CHERRY",
"CHERRY")), row.names = c(NA, -26L), class = c("tbl_df",
"tbl", "data.frame"))