Search code examples
exceldateexcel-formulaformulas

Excel-Formular - Get last workday


In my sheet I want to get the last workday (So sundays and sutarday should be ignored) before the current day, if in A2 is "Select".

So for example if today is monday and in A2 is "Select" the formular should result in the friday of the previous week.

The formular I have only can get the last day but won´t ignore the weekends.

=IF(A2="Select",TODAY()-1)

Can you give me some advice please?


Solution

  • If I get you right, you always want to get the workfday before the current day.

    try the following:

    =IF(A2="Select";TODAY()-IF(WEEKDAY(TODAY())<=2;WEEKDAY(TODAY())+1;1))

    Note: I´m working on a german client so im not sure about the semicolons, you might need to replace them with a commas