+ Reply to Thread
Results 1 to 4 of 4

Fixed Cell Reference Minus a Fixed Number

  1. #1
    Registered User
    Join Date
    07-03-2013
    Location
    Boulder, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    4

    Fixed Cell Reference Minus a Fixed Number

    I want to set a cell reference up such that I can look at the current cell line number and minus a certain constant, k, from that cell line number to reference another cell.

    Why do I want to do this? So that I can copy and paste a chunk of table and have cells, call them X, reference other cells, call them Y, a certain number of lines above cells X. I would usually set up a fixed line number (i.e. G$145 is referenced by G175), but I don't always want to reference G145; I only want G175 to reference G145. If I copy and paste this chunk of table 40 lines down (G185), I want G215 to reference G185, not G145--hence, I can't use G$145 in my formula.

    In theory, it would look like this:

    IF( G(linenumber(thiscell) - 30) = 1, "cool", "not cool")

    This would look at this current cell, check its line number, and reference a cell 30 lines above it (I'll be using an IF statement, so this should be illustrative of my issue).

    I hope my explanation was helpful, I know it might look a bit convoluted. Any help would be appreciated!

  2. #2
    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
    52,933

    Re: Fixed Cell Reference Minus a Fixed Number

    Hi and welcome to the forum

    Maybe something like this?

    =IF(INDIRECT("G"&ROW()-30)=1,"cool","not cool")
    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

  3. #3
    Registered User
    Join Date
    07-03-2013
    Location
    Boulder, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Fixed Cell Reference Minus a Fixed Number

    I believe that exactly answers my question! Thanks so much!

  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
    52,933

    Re: Fixed Cell Reference Minus a Fixed Number

    Happy to help and thanks for the feedback

+ 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