If possible, switch to using datetime instead of serial date numbers. You can use the datetime options 'ConvertFrom', 'excel' or 'ConvertFrom', 'excel1904' to create the datetime array from the Microsoft Excel data.
If you use datetime you can use day (with the 'dayofweek' KIND input), isweekend, and/or dateshift.
D = datetime('today');
dayName = day(D, 'name')
dayCode = day(D, 'dayofweek')
sundayBefore = dateshift(D, 'start', 'week')
If you want to go further with your classification of working days than just "weekday or weekend", the holidays function in Financial Toolbox accepts datetime as inputs.