Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To use the If function to exclude non-workdays, you can use the following formula:

=IF(WEEKDAY(date,2)>5,"",formula)

In this formula, the WEEKDAY function returns a number from 1 to 7 that represents the day of the week for a given date. A number greater than 5 indicates a non-workday, as weekends are represented by 6 and 7. The IF function then checks if the date is a non-workday and returns an empty cell if true, otherwise it calculates the desired formula.

For example, if you want to calculate the sum of values in cells A1:A10 but exclude non-workdays, you can use the following formula:

=IF(WEEKDAY(A1,2)>5,"",SUM(A1:A10))

This formula checks if each date in the range A1:A10 is a non-workday and shows an empty cell for those days. For workdays, it calculates the sum of values in the range.