use formula with different cells

Misifuso

New Member
Joined
Oct 3, 2013
Messages
4
Hi all,

I have a formula:
=IF(C7<0.000001,"Remote/Improbable",IF(C7<0.00001,"Unlikely",IF(C7<0.0001,"Possible",IF(C7<0.001,"Likely",IF(C7<0.01,"Frequent")))))

I use this formula with differents cells each time, ie, C7, C10, C12, etc..

1. Can I write the formula in another cell and each time I need to use it, I take from there and write wich cell I want to reference?
For example, I write this formula in another cell and call it by a name I defined, and after that I can use like: =MY_FORMULA(my_cell)???
2.After that, I will want to use the formula in other sheets? How can I reference to the formula from another sheet?


tanx
Misifuso
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Firstly, welcome to the board, I hope you find what you need.

The only way I know to achieve this is to create a UserDefined Function, which is not as daunting as you might imagine, the following steps should help.

1. Press ALT+F11 or select 'Visual Basic' from the Developer Ribbon if you've got it enabled (Customise Ribbon and put a tick against Developer in right hand pane).

2. Right click the VBAProject1 in the left hand pane, from the pop up menu choose 'Insert' 'Module'. You should see 'Module 1' appear in the left hand pane and a new window on the right which is the code entry window for 'Module 1'.

3. Enter the following code in the new window:

Code:
Function MyFormula(Src As Range)
    Select Case Src
        Case Is < 0.000001
            MyFormula = "Remote/Improbable"
        Case Is < 0.00001
            MyFormula = "Unlikely"
        Case Is < 0.0001
            MyFormula = "Possible"
        Case Is < 0.001
            MyFormula = "Likely"
        Case Is < 0.01
            MyFormula = "Frequent"
        Case Else
            MyFormula = "Over 0.01"
    End Select
End Function

4. Press ALT+F11 to return to you spreadsheet.

5. When you want to use your formula simply enter =Myformula(C7) and change C7 to suit your purposes. Obviously you can amend the text thats displayed and the limits by editing the function.

Hope this helps.

Regards
 
Upvote 0
my pleasure - and many thanks for the feedback, its nice to know when something works.
 
Upvote 0

Forum statistics

Threads
1,216,127
Messages
6,129,022
Members
449,481
Latest member
joaotcosta23

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