+ Reply to Thread
Results 1 to 13 of 13

Named formulas to reference relative rows?

  1. #1
    Registered User
    Join Date
    01-14-2009
    Location
    southern california
    MS-Off Ver
    Excel 2007
    Posts
    23

    Named formulas to reference relative rows?

    Formula: B2+C2

    In columnD I want to reference the "formula" and have it calculate based on the values in whatever row references the formula.

    As it stands I can only get the formula to calculate within the same row.




    I attached a worksheet of what I'm looking for.
    Attached Files Attached Files
    Last edited by atreyu55; 06-17-2009 at 06:15 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Named formulas to reference relative rows?

    not sure I follow... copying down the formulae generates the correct totals as far as I can see (ie year1 + year2 are relative to the row in which the formula is called) ... but begs the question why not simply:

    F2: =SUM($B2:$C2)
    G2: =$B2-$C2

    copied down

    Apologies if I'm missing a key point here...

  3. #3
    Registered User
    Join Date
    01-14-2009
    Location
    southern california
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Named formulas to reference relative rows?

    The worksheet I sent was very simplified to not confuse anyone with the mess Im working on.

    Basically, Im working on a weight chart which alot of the calculations vary depending on male / female.

    If I leave things as they are the functions get more messy than I like:
    =IF(ISNUMBER(C13),IF(ISNUMBER(SEARCH("FEMALE",$D$9)),SUM(163.205*LOG10(E13+F13-D13)-97.684*LOG10(feet*12+inches)-78.387)/100,IF(ISNUMBER(SEARCH("MALE",$D$9)),SUM(((86.01*LOG(E13-D13,10))-(70.041*LOG(feet*12+inches,10))+36.76)/100),"- -")),"")

    I could just leave it as is (and copy down, which is what i have been doing), but Im trying to simplify things so they arn't so messy if I ever need to modify things.
    Last edited by atreyu55; 06-17-2009 at 05:24 AM.

  4. #4
    Registered User
    Join Date
    01-14-2009
    Location
    southern california
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Named formulas to reference relative rows?

    So i would like to change the previous function to something like this so i reference the formula rather than copy and paste it.

    =IF(ISNUMBER(C13),IF(ISNUMBER(SEARCH("FEMALE",$D$9)),bodyfat_f,IF(ISNUMBER(SEARCH("MALE",$D$9)),bodyfat_m,"- -")),"")

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Named formulas to reference relative rows?

    It would I think be a good idea to post a small representative sample of your data (remove names etc) with existing results present, this way we can test with reflective data and ensure our logic ties out to the existing non-named versions.

    I see your point re: shortening the formula - there are differing opinions on whether or not one should use Named Ranges - yes they make it more readable but perhaps at the expense of audit trail (more complex to work through should a problem arise) ... they can also affect performance.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Named formulas to reference relative rows?

    Perhaps we may be able to get there...

    If we assume the formula is going in say G13 - then highlight that cell and then subsequently create the Named Ranges such that:

    Please Login or Register  to view this content.
    You should then find you can use:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-14-2009
    Location
    southern california
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Named formulas to reference relative rows?

    sorry it took me a moment to clean it up enough to understand it without all my notes covering it up.
    Attached Files Attached Files

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Named formulas to reference relative rows?

    Having looked at the file, if you follow the earlier instructions (but amending existing names as opposed to creating new ones) you should find you get your desired results via the shortened formulae.

  9. #9
    Registered User
    Join Date
    01-14-2009
    Location
    southern california
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Named formulas to reference relative rows?

    Unfortunately your suggestion is what i have tried so far. Doing that just copies the same answer down the column rather than changing based on the values in that row.

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Named formulas to reference relative rows?

    Works without incident for me I'm afraid... be sure you're entering $D13 and not $D$13 etc in your formulae.

    EDIT: added working attachment
    Attached Files Attached Files
    Last edited by DonkeyOte; 06-17-2009 at 06:07 AM.

  11. #11
    Registered User
    Join Date
    01-14-2009
    Location
    southern california
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Named formulas to reference relative rows?

    hmmm... i dont know what im doing wrong then... let me play with it to see what im missing.

  12. #12
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Named formulas to reference relative rows?

    I have just added your file updated as per instructions to my last post.

  13. #13
    Registered User
    Join Date
    01-14-2009
    Location
    southern california
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Named formulas to reference relative rows?

    ah... i see where I went wrong.

    THANKS! As always you are a great help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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