I have an Excel spreadsheet with 73300 rows (representing firms) from 144 countries and dozens of columns (with entries for each firm, e.g. sales, # of employees, private or state-owned, market value, etc). This panel is unbalanced, i.e. the number of firms in each country is different. How do I get an average of column values (sales, # of employees, etc.) for each COUNTRY without having to manually go through all 144 countries?
I know how to do the "calculate the average of for the COUNTRY column a cell equals the previous cell and put NA otherwise" but I don't know how to tell the program to select the varying quantity of rows. Say, I have 533 firms in country 1, 274 firms in country 2, 797 firms in country 3, etc. How do I write the "find the average sales figure over all firms in a given country" without copying and pasting the average formula 144 times? THANK YOU!