Udf

drl44

New Member
Joined
May 12, 2011
Messages
5
Hi
I am using this formula over and over and changing the A1 cell references is there an easier way to do this.
Here is the formula
=RANDBETWEEN(LEFT(A1,FIND("d",A1)-1),RIGHT(A1,LEN(A1)-FIND("d",A1))*LEFT(A1,FIND("d",A1)-1))
I think a UDF is the answer I’m looking for but do not have any experience with UDF
Any help would be appreciated
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
A couple of ways, depending on when you are changing the A1.
1) Use a named Range. Define a name myCell RefersTo: =Sheet1!$A$1

Then the formula =RANDBETWEEN(LEFT(myCell, FIND("d",myCell)-1), RIGHT(myCell,LEN(myCell)-FIND("d",myCell))*LEFT(myCell,FIND("d",myCell)-1))

Changing the definition of myCell will effect all of the cells with the formula.
If it appears in multiple places in the spreadsheet, relative referencing in the definition of myCell might be appropriate.

Under what circumstances are you changing A1?
Will Excel's relative/absolute addressing meet your need, so that copy/paste or fillDown or other cell copying methods can be used?
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

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