+ Reply to Thread
Results 1 to 19 of 19

How to rename a formula

Hybrid View

  1. #1
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Question How to rename a formula

    Hi all,

    I thought this might be simple, but it seems to be more difficult than it sounds.

    If I have 2 formulas in the one cell. Example:
    =sum(A1:A5)*IF(A1>0,A1*B1,0)

    Is there a way to rename each formula as such:
    =TOTAL*VARIABLE

    Where;
    TOTAL=sum(A1:A5)
    and
    VARIABLE=IF(A1>0,A1*B1,0)


    BUT... The tricky part is, I don't want the renamed formulas to be absolute. I.e. If I drag the formula down, I would like the cell referencing to drag down also.


    I have attached an example for reference.

    Thanks in advance.
    D.
    Attached Files Attached Files
    Last edited by m1zz13; 02-10-2013 at 03:22 AM. Reason: Added example

  2. #2
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: How to rename a formula

    use the functionality of Named Ranges.

    create one Named Range called Total and another called Variable with exactly the formula you want, and then use those two Named Ranges in a formula just like you desire.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  3. #3
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: How to rename a formula

    Thanks icestationzbra,

    I am trying to avoid using cell referencing by placing each individual formula in different cells, then renaming them for future referencing.

    I am trying to get the two formulas to be in the one cell only (apart from the data ranges mentioned within these formulas).

    Is that possible without cell referencing?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to rename a formula

    I believe that icestationzebra answered your question for you already then. If you use "define name", give the ramne the name TOTAL, and in the "refers to" section, use =SUM(Sheet1!$A$1:$A$5), then every time you enter =total, it will give you the total of A1:A5

    Quote Originally Posted by icestationzbra View Post
    use the functionality of Named Ranges.

    create one Named Range called Total and another called Variable with exactly the formula you want, and then use those two Named Ranges in a formula just like you desire.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: How to rename a formula

    I am familiar with the functionality of renaming cells or ranges, then being able to refer them when using new formulas.

    The only matter is that I don't want the SUM(A1:A5) to be absolute.

    Essentially what I am trying to achieve is shorter formulas in the Formula Bar to make it a bit clearer and more workable when using very long formulas.

    see attached example.
    Attached Files Attached Files

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to rename a formula

    so you want a formula that doesnt reference cells, and you want a formula in each cell....but you want them both in the same cell?

    sorry, that doesnt make any sense to me, perhaps you can try top explain in more detail what you are trying to achieve?

  7. #7
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: How to rename a formula

    Quote Originally Posted by FDibbins View Post
    so you want a formula that doesnt reference cells, and you want a formula in each cell....but you want them both in the same cell?

    sorry, that doesnt make any sense to me, perhaps you can try top explain in more detail what you are trying to achieve?
    FDibbins,

    Essentially I am trying to rename a mathematical formula within a cell. I.e. I want this formula 'SUM(A1:A5)' to be renamed to the word TOTAL. So that every time I use the word 'TOTAL' in the formula bar, it will refer to that formula.

    Does that make more sense?

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to rename a formula

    OK, I understand now. Im not sure if what you want is possible using just regular functions/formulas, perhaps some-one can put some VBA code together for you

  9. #9
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: How to rename a formula

    Thanks FDibbins,

    It's a toughy, but it's an answer worth waiting for because some of the formulas I am currently working on are getting quite long and confusing to work with.

  10. #10
    Forum Contributor
    Join Date
    11-10-2012
    Location
    India
    MS-Off Ver
    Excel 2003 to Excel 2010
    Posts
    235

    Re: How to rename a formula

    Go to name manager and define name there u can do that
    Attached file is there to check
    do =answer() and put enter and there would no cell referencing in that
    Attached Files Attached Files
    Click on (*), if you agree.

  11. #11
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: How to rename a formula

    Quote Originally Posted by vjharry View Post
    Go to name manager and define name there u can do that
    Attached file is there to check
    do =answer() and put enter and there would no cell referencing in that
    Thanks VJ,

    Where can I find the name manager?

    This is exactly what I am after.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to rename a formula

    @vjharry, if you do the naming correctly, it will give you the total you want. However, the ranges do not adjust if copied/dragged

    @m1zz13, I would question why you need this in the 1st place. If you create the formula, like you have, and then just copy/drag, I dont see the problem. If your formulas are that long, maybe they can be condensed?

  13. #13
    Forum Contributor
    Join Date
    11-10-2012
    Location
    India
    MS-Off Ver
    Excel 2003 to Excel 2010
    Posts
    235

    Re: How to rename a formula

    @FDibbins .....i have shown all it want by m1zz13..

    @m1zz13.. pl let me now if any thing left
    Thanks Again,

  14. #14
    Forum Contributor
    Join Date
    11-10-2012
    Location
    India
    MS-Off Ver
    Excel 2003 to Excel 2010
    Posts
    235

    Re: How to rename a formula

    please do Alt+M+M
    there you will find that

    or in Formulas tab there u will find that ...

  15. #15
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: How to rename a formula

    FDibbins,
    I am trying to make a 400 character+ formula into something more manageable. The only issue, once this is finished, I would like to copy this onto more cells, and when I drag it down down, whichever cells that aren't absolute, I need them to continue referencing down the column.

    it is merely to make it more visually manageable and less confusing.


    VJay,
    Thanks it works perfectly.
    Last edited by m1zz13; 02-10-2013 at 03:22 AM.

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to rename a formula

    yes I know how to get into the name manager...your method does not work. inthe file you uploaded, type in =answer into any cell - try G19 - it gives 0

  17. #17
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: How to rename a formula

    @FDibbins, if you place the formula =Answer in G19, the referencing drags across, which is exactly what I was after. If the cells within the formula I renames are absolute, I want to to stick (e.g. $A$1 will always remain). but if the cells aren't locked, I need them to move across when dragged.

  18. #18
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to rename a formula

    ok cool, glad you got the answer you want

  19. #19
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: How to rename a formula

    Thanks for all your efforts FD and VJ

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1