I have 100 Excel sheets of financial statement to extract selected data. For instance, the first sheet is from company A, its ‘Total assets’ item is in A10, but in the second sheet the ‘Total assets’ is in A17, the third in A12….
So every financial statement’s items have different positions in their Excel sheet. Is there any way I can extract them by specify their name, such as ‘Total assets’, ‘Other earning assets’ etc, then I don’t need to read their location one by one.
sorry about the delay. You’ll want to import the data using
numwill be a matrix of the numerical values whiletxtis a cell array of all the text values. Next you’ll need to searchtxtfor your desired phrase using something likeThis will give you a list of columns and the corresponding rows where you’ll find that phrase in
txt. Then it’s just a matter of plugging that row back intonumto get the data you need. Keep in mind that the sizes ofnumandtxtmight be a bit off depending on how your data is formatted. I suggest.xlsfiles if you can.