+ Reply to Thread
Results 1 to 4 of 4

Answer's a little more complicated than regular formulas, but what do I need to do?

  1. #1
    Jordan Smith
    Guest

    Answer's a little more complicated than regular formulas, but what do I need to do?

    I have three columns: "Number 1," "Number 2," and "Difference" (which
    is Num 1 - Num2).

    In a given row, I want to be able to enter any 2 of the fields and have
    Excel calculate the 3rd one.

    I.e.: (=x are the numbers excel calculates. The other numbers I type
    in)
    Num1 Num2 Diff
    4 2 =2
    =2 1 1
    3 =2 1


    How can this be done?

    Thanks,
    Jordan


  2. #2
    Forum Contributor
    Join Date
    03-21-2006
    Posts
    205
    If you can live with circular references until the values are entered:

    Cell A2:
    =B2+C2

    Cell B2:
    =A2+C2

    Cell C2:
    =A2-B2

    Copy formulae down


    Otherwise separate the input area (A2:C100) and the output area (D2:D100)

    Cell D2:
    =IF(COUNTA(A2:C2)<2,"",IF(A2="",B2+C2,A2))

    Cell E2:
    =IF(COUNTA(A2:C2)<2,"",IF(B2="",A2+C2,B2))

    Cell F2:
    =IF(COUNTA(A2:C2)<2,"",IF(C2="",A2-B2,C2))

    Copy formulae down

    Alternative: A macro
    Last edited by John James; 04-19-2006 at 01:32 AM.

  3. #3
    Michael M
    Guest

    RE: Answer's a little more complicated than regular formulas, but what

    Hi Jordan
    I don't really know why you would want to do this, but here is one solution.

    If the column headers are in A1,B1, and C1 create 3 more columns in say
    E1,F1 and G1.

    Now, in cell E2 put the formula =IF(A2="",B2+C2,A2) and copy down as far as
    you need.
    In Cell F2 put the formula =IF(B2="",A2-C2,B2) and do the same.
    Finall, in cell G2 put the formula=IF(C2="",A2-B2,C2) and also copy down as
    far as needed.

    As you fill in the data in the original cells, the new columns will populate
    the required answers.

    When completed you can hide the original columns.
    This is a fairly ugly solution, but will work. Other option is to use VB

    HTH
    Michael.

    In cell


    "Jordan Smith" wrote:

    > I have three columns: "Number 1," "Number 2," and "Difference" (which
    > is Num 1 - Num2).
    >
    > In a given row, I want to be able to enter any 2 of the fields and have
    > Excel calculate the 3rd one.
    >
    > I.e.: (=x are the numbers excel calculates. The other numbers I type
    > in)
    > Num1 Num2 Diff
    > 4 2 =2
    > =2 1 1
    > 3 =2 1
    >
    >
    > How can this be done?
    >
    > Thanks,
    > Jordan
    >
    >


  4. #4
    Jordan Smith
    Guest

    Re: Answer's a little more complicated than regular formulas, but what do I need to do?

    Thanks John.

    I don't really want the circular references because I want to make it
    possible to change the numbers. Seperating out the input from output
    looks like what I will have to do. (I wasn't aware of the counta
    function which will help also.

    Thanks again.

    Michael: I know that my example may raise eyebrows. I am working on a
    more complicated spreadsheet and used this example to get an answer to
    the problem without bogging everyone down in understanding my "final"
    goal Thanks for your answer though. I'm going to try and use what
    you guys have given me tomorrow. It's just about 3am here, haha.


+ 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