title: Excel formula for previous weekday
body: <p>I have a macro in which asks user for a date and it opens the file corresponding to the date and performs some operation. However, instead of entering the date manually I am trying to write an excel function to calculate the previous weekday. This is because the date I usually enter corresponds to the previous weekday.</p>
  
  <p>For example, if today is Monday, I want last week's Friday date- and for the rest of the weekdays upto Friday, it's just the previous day. There won't be files corresponding to weekends.</p>
  
  <p>How can I do this ?</p>