Info

This question is closed. Reopen it to edit or answer.

How can I get the row of a certain value in excel

2 views (last 30 days)
abich
abich on 12 Jun 2017
Closed: MATLAB Answer Bot on 20 Aug 2021
I have an excel file of two sheets. In each sheet i have 2 columns, the first representing some IDs(corresponding to some tasks) and the second representing minutes, so all the values are of type integer. At first, i search for a redundant task ID in both sheets, then I look for the minutes corresponding to the task in both sheets and then i shall calculate the difference. So Here is the code I used
if true
firsttasks = xlsread('myfile1','Feuil1', 'A1:A3');
secondtasks = xlsread('myfile1', 'Feuil2', 'A1:A3');
Lia = ismember(firsttasks,secondtasks,'rows');
for i=1:3
if Lia(i) == 1
found = firsttasks(i);
%get the minutes for the redundant task 'found', in sheet 1
minute1 = raw(i,i);
end
end
end
At this point, i have extracted the redundant task and the minutes corresponding to it in the first sheet. Now i need to extract the minutes from the second sheet, corresponding to the same task ID.
I am relatively new to Matlab, so im sure there's an even better way to do all this. Thanks in advance for your help.

Answers (0)

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!