barbiepylon
barbiepylon

Reputation: 911

Calculate execution time of Excel Spreadsheet calculations?

Is it possible to calculate the execution of excel functions? E.g. how long does it take to sum 30 rows?

My company has coding challenges and we're thinking about adding in execution time of your solution as a metric/bonus points, but one of the business folk does all of them in excel (and he's rather good at it) and I can't find a way to time the execution.

Any ideas?

Upvotes: 2

Views: 3360

Answers (2)

user4039065
user4039065

Reputation:

You haven't provided much to go on but a rudimentary stopwatch accurate to the millisecond can be achieved with Timer.

application.calculation = xlcalculationmanual
with range("a31")
    debug.print timer
    .formula = "=sum(a1:a30)"
    .calculate
    debug.print timer
end with
application.calculation = xlcalculationautomatic

Subtract the first Timer from the second or possibly record the first as a double and make the subtraction part of the procedure.

Upvotes: 2

Mats Lind
Mats Lind

Reputation: 934

I have looked into this as I have rather large calculations in Excel. The software I have used, which is free to use (just copy from the link below) has been flexible enough for me. You could for instance use the "Range Timer" to clock your cell summing 30 others. Here are some profiling tips on microsofts site together with the code.

Upvotes: 2

Related Questions