Compare a column in two different excel-sheet
Show older comments
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,
Answers (1)
dpb
on 27 Jul 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);
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!