The below function takes in a dataframe consisting of an excel sheet with the Price column. It works correctly however it looks unnecessarily long for something quite simple