I am trying to show the flow of passengers from different stations. The data table looks like:
station_from | quantity | station_to
A 10 B
A 10 C
B 5 A
A 10 B
So I would like to get such histogram:
Could you write me any tips to get it in excel?
CodePudding user response:
You need to get your data into two columns like this so you can select E1:G4 and draw a column chart with two series:
There are a number of ways of getting a list of all the station names without duplicates in column E, but once you have done this you can just use a simple formula to get the total in for each station in F2 :
=SUMIFS(B$2:B$5,C$2:C$5,E2)
and the total out in G2
=SUMIFS(B$2:B$5,A$2:A$5,E2)
and copied down.