Hello All,
I want to create custom RANDBETWEEN function to stop excel from recalculating with every click. I want to make it work for this formula.
=IF(NOT(ISBLANK(B3)),RANDBETWEEN(15,1506009),"")
Please help. Thanks
Hello All,
I want to create custom RANDBETWEEN function to stop excel from recalculating with every click. I want to make it work for this formula.
=IF(NOT(ISBLANK(B3)),RANDBETWEEN(15,1506009),"")
Please help. Thanks
It seems like a simple UDF, so I am not sure what part of coding the UDF you would need help with. It seems like it should be as simple asCalled as =MyRandbetween(15,1506009) or nested inside of your IF() function just like the built in function =IF(NOT(ISBLANK(B3)),MyRANDBETWEEN(15,1506009),"")![]()
Please Login or Register to view this content.
There may be some question about when you do and don't want it to recalculate. As a UDF, it will recalculate the random number whenever Excel decides to calculate that cell. Nested inside of your IF() function, that will mean that anytime B3 ends up in the "to be calculated" list, this cell will be recalculated. So anytime B3 changes, or the cells B3 depends on are changed. It will also recalculate whenever a full recalculation is performed (like at file open). You may want to test it in many different scenarios so you can see if it is working the way you want.
Originally Posted by shg
Try...
Or use Application.RandBetween()![]()
Please Login or Register to view this content.
"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
― Robert A. Heinlein
Thank you all it worked.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks