Average Data from Multiple Excel Log Files

AI Thread Summary
To efficiently extract and average data from a specific cell across multiple Excel spreadsheets with the same structure, using VBA (Visual Basic for Applications) is recommended. A macro can be written to automate this process, especially if the spreadsheet names follow a sequential format, such as log001.xls, log002.xls, and so on. This allows for the implementation of a do-loop that increments the spreadsheet name with each iteration. Familiarity with programming concepts from other languages can facilitate learning VBA, making it accessible even for those new to it. Engaging with a VBA tutorial can provide the necessary skills to accomplish the task.
antonantal
Messages
242
Reaction score
21
I have a lot of Excel spreadsheets which are actually log files from a test (so they all have the same structure) and I need to get the data (a number) from a specific cell (same cell) in each file and do their average.

Does anybody know an efficient method to do this?
 
Physics news on Phys.org
I would try writing a macro to do this. Have you done any programming in VBA (the language of Excel and Word macros) yet?
 
No I have never programmed in VBA. But if you say that it can be done using VBA I'll give it a try.
 
It's not hard to do if you've programmed in other languages.

It would help if the spreadsheet names are sequential in some fashion, for example:

log001.xls
log002.xls
log003.xls
etc. etc.

Then you can write a do-loop where the spreadsheet name increments each time through the loop.
 
Redbelly98 said:
It's not hard to do if you've programmed in other languages.

It would help if the spreadsheet names are sequential in some fashion, for example:

log001.xls
log002.xls
log003.xls
etc. etc.

Then you can write a do-loop where the spreadsheet name increments each time through the loop.

Yes, the names are sequential. Thanks for the suggestion. I am looking right now over a VBA tutorial.
 

Similar threads

Replies
3
Views
2K
Replies
18
Views
6K
Replies
2
Views
2K
Replies
3
Views
2K
Replies
2
Views
1K
Replies
13
Views
1K
Replies
5
Views
8K
Back
Top