MATLAB Answers

0

remove weekends and holidays data from excel file

Asked by MUKESH KUMAR on 15 Jan 2019
Latest activity Answered by KSSV
on 15 Jan 2019
Accepted Answer by KSSV
I had excel file ABC.xlsx, in which sheet A having data from date 01-04-2017 to 31-12-2018 and the sheet2 having the list dates which are holidays( holiday may be fall on weekends). So now I want to create a another excel to seprate the weekdays and weekends/holidays data???
Thanks

  0 Comments

Sign in to comment.

1 Answer

Answer by KSSV
on 15 Jan 2019
 Accepted Answer

% Read data
T1 = readtable('ABC.xlsx','sheet',1) ;
T2 = readtable('ABC.xlsx','sheet',2) ;
% Get dates common in both
idx = ismember(T1.(1),T2.(1)) ;
% Pick which are not common
T = T1(~idx,:) ;
% write to a file
writetable(T,'test.xlsx')

  0 Comments

Sign in to comment.