+ Reply to Thread
Results 1 to 6 of 6

How to Change Absolute Cell Reference based on a couple of conditions

  1. #1
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    How to Change Absolute Cell Reference based on a couple of conditions

    I have a workbook that contains a column, G, which includes a formula that calculates distances (based on lat, long coordinates) to a training site ("TS" going forward) from other sites within the same district as that TS.
    There are numerous TS's in the company, usually 1 per district (but some districts do not have a training site), and I am trying to find a way to change my distance formula that will automatically detect which site is a TS, and then calculate the distances of those other sites in that same district to their respective TS's.

    As it stands, I have to manually change an absolute cell reference every time I encounter one of these TS locations in the file (designated by a "TS" in Col F), and rerun the distance formula down the column.
    I would hate to have to do this several hundred times.


    Attached is a sample file.
    Again, Col G contains the formula for distance calculation, and you will notice that the absolute cell references change each time a TS is encountered -- I have been doing this manually.
    Additionally, I would be curious to know if there is a way to spot any Districts that lack a TS, as in District 493, and specify that in Col G.


    I would be eternally grateful for any assistance provided.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to Change Absolute Cell Reference based on a couple of conditions

    Hi,

    Use a helper column
    H2 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    G2: copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Re: How to Change Absolute Cell Reference based on a couple of conditions

    Richard,

    This is a very brilliant solution that solves the first problem I had encountered.
    Any thoughts on how to check against a TS being nonexistent when coming across a new district number?

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to Change Absolute Cell Reference based on a couple of conditions

    Hi,

    G2:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    H2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Re: How to Change Absolute Cell Reference based on a couple of conditions

    Richard,

    This is awesome.
    Thanks!

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to Change Absolute Cell Reference based on a couple of conditions

    Hi,

    Glad to have been able to help, and thanks for the rep. point.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Modify change event to absolute cell reference?
    By Marvelous in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2013, 07:03 PM
  2. Loop based on a couple of conditions
    By h_aesa1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-31-2010, 01:22 PM
  3. How to change absolute cell reference with formula
    By mzypt in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-10-2008, 11:36 AM
  4. [SOLVED] Change linked cell reference to absolute
    By RAP in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-22-2005, 11:05 AM
  5. [SOLVED] How do I change a cell from absolute reference to relative referen
    By simonsez in forum Excel General
    Replies: 1
    Last Post: 05-17-2005, 04:06 PM

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