Excel help me with a basic formula : So I have a spreadsheet with hundreds of lines. For Example:

A1=E, A2=E, A3=S, A4=E, A5=S, A6=C, A7=C, A8=E    

I am looking for help if it's even possible to have a formula that I can drag down and based on the sequence it can determine the category for me. For example if E then E only, if E followed by S then result shows as "E + S", if E followed by S and C or multiple Cs then "FM" to indicate family. Please help as it is truly appreciated.