+ Reply to Thread
Results 1 to 7 of 7

Can I have 2 cells whose formulas reference each other?

  1. #1
    Registered User
    Join Date
    12-10-2010
    Location
    Albuquerque NM
    MS-Off Ver
    Excel 2000
    Posts
    3

    Can I have 2 cells whose formulas reference each other?

    I tried the simple case and it didn't work, so I'm wondering if somebody has a clever solution to this.

    I'd like to have two cells, one for weight in lbs, one for kg. I'd like to be able to plug in lbs and it'd show kg, and I'd like to be able to plug in kg and get lbs. But when I plug in the mutual referenced formulas I get an error.

    Is there some way to do this?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Can I have 2 cells whose formulas reference each other?

    Welcome to the forum.

    That is a "Circular Reference". In theory, you can create circular references but you have to set iterations in the options and it's an application wide parameter. In the grand scheme of things, not good.

    You could do it with a VBA Worksheet Change Event handler monitoring the two cells.


    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    12-10-2010
    Location
    Albuquerque NM
    MS-Off Ver
    Excel 2000
    Posts
    3

    Re: Can I have 2 cells whose formulas reference each other?

    Thank you. Both ideas sound kind of ugly and hairy.

    So the short answer for me is 'no'. :-)

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Can I have 2 cells whose formulas reference each other?

    Quote Originally Posted by paulkinzelman View Post
    Thank you. Both ideas sound kind of ugly and hairy.

    So the short answer for me is 'no'. :-)
    Pretty much. The VBA option is probably simpler than it sounds, but if you're not familiar with VBA, maybe don't go there.

    The simplest option would be to have two (optional) input cells; one for lbs and one for kg. Then output the converted value in adjacent cells using the formula. The output cells could be locked (and the sheet protected). You could maybe have a fifth cell that contains the conversion factor.

    See the attached example.
    Last edited by TMS; 08-27-2024 at 06:06 PM.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,343

    Re: Can I have 2 cells whose formulas reference each other?

    I agree that this is an overly complicated way to do this (circular logic with two different input/output cells and each cell has to figure out at run time whether it is input or output). If it helps, here's how I typically set this sort of thing up:

    1) Designate three input cells. One cell will be for the input mass. The other will be for inputting the units associated with this value. The third will be for entering the desired output units. For now, B1 is the mass, B2 is the input unit, B3 is the output unit.
    2) In my output cell (maybe B4), enter a CONVERT() function =CONVERT(B1,B2,B3).

    Now, as long as I input the correct unit text strings (see CONVERT() help file: https://support.microsoft.com/en-us/...d-666c810f9af2 ), then I can convert any mass between any two mass units by simply entering the desired values in B1:B3. If someone other than myself needs to use this spreadsheet, I might include a data validation list and rule for B2 and B3 to aid in entering the correct mass unit text (especially for something like lbm for pounds, since most people don't distinguish between lb-mass and lb-force).

    I don't know if that helps, but that's how I like to do this sort of thing.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Can I have 2 cells whose formulas reference each other?

    Here's an updated sample file with MrShorty's solution implemented.

  7. #7
    Registered User
    Join Date
    12-10-2010
    Location
    Albuquerque NM
    MS-Off Ver
    Excel 2000
    Posts
    3

    Re: Can I have 2 cells whose formulas reference each other?

    Yes, I don't know VBA. And I understand I can use multiple cells, but it's part of a form used by medics and they don't like changes, so I was trying to do it within the 2 cells that are there already. Sometimes they get patient weights in LBS, and other times in KG. So they'll just have to do it by hand depending on the direction.
    Thanks for your ideas.

    It would be interesting to enhance Excel to allow the ability to have a circular reference that will just sit there and not be evaluated. Then plug in a number in one of them to step on the formula, then the other cell will use that number in its evaluation.

+ 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] Shift cells down changes reference in formulas
    By wyowhite in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2020, 12:04 PM
  2. Replies: 11
    Last Post: 10-07-2015, 06:08 AM
  3. [SOLVED] Formulas that reference other cells
    By ExcelHound75 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-21-2013, 05:53 PM
  4. Formulas not calculating in reference to other cells
    By Bertiee in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-13-2012, 11:26 AM
  5. Excel 2007 : Formulas that reference cells with formulas
    By grey_fox33 in forum Excel General
    Replies: 1
    Last Post: 06-23-2012, 10:00 PM
  6. Replies: 1
    Last Post: 05-18-2010, 07:50 PM
  7. Formulas to reference cells
    By jeb225 in forum Excel General
    Replies: 1
    Last Post: 10-27-2009, 10:12 AM

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