Use of UDF functions that take a long time to calculate

kato01

Board Regular
Joined
Sep 9, 2005
Messages
81
Hello,

I am trying to use the excel solver for an optimization that requires a long time for the goal function to be calculated.

For that, I need to use a UDF function.

Specifically:

In C3 I have =fun(c1,c2) and fun takes like an hour to calculate.

Not sure how I am supposed to deal with this. The C3 seems to be inactive but the script calculating the goal function is not doing anything.

I tried an exercise with an UDF function similar to the one below:

Code:
Function Test(x,y)
If Application.Wait(Now + TimeValue("00:00:10")) = True Then
aa=90
else
Test=x+y
End If

In Cell D2 I have =test(B2,B2) B2=4 and C2=5, so I was expecting to wait 10 sec and get in C3 the number 9.

What I get is an error : #Name

Any ideas?

Thank you
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top