Compare a column in two different excel-sheet
Afficher commentaires plus anciens
I would like to have an idea on how to compare a column in two different excel sheets.
ex,
sheet 1 column A Sheet 2 column A
5 4.4
5 4.6
5 3
5 7
What i want is to find the columns that have differences in numbers between the two sheets and if column A in sheet 2 is +/- 1 of column A in sheet 1 then give an output of "good"
if more that +/-1 give an output "bad"
Thanks,
Réponses (1)
dpb
le 27 Juil 2021
Just read both sheets --
CODES=categorical({'bad','good'}).'; % the output categories
A1=readmatrix('WorkbookFileName.xlsx','Sheet',1);
A2=readmatrix('WorkbookFileName.xlsx','Sheet',2);
isOK=CODES((abs(A2-A1)<=1)+1);
Catégories
En savoir plus sur Data Import from MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!