Priorities based on end date

Hi I was hoping someone could help me with this, I'm new to Smartsheet and not overly familiar with IF statements. I was wondering if there's a way to automate by priorities based on my end date. For example if the end date is within 2 weeks, priority is high, within the month, priority is medium and at any other time tasks are low priority.