+ Reply to Thread
Results 1 to 9 of 9

Recalculate using two different formulas in same cell

  1. #1
    Registered User
    Join Date
    10-18-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    67

    Question Recalculate using two different formulas in same cell

    I need to create a drop down menu or something of that sort, that allows the user to select what units he wants his results to be in.

    When a particular units system is selected, the results must be recalculated and displayed in their respective cells.

    No matter which units are selected, the units must always be displayed in the same set of cells, that means the formula or reference in the set of those output cells must change automatically, based on the units selection.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Recalculate using two different formulas in same cell

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Recalculate using two different formulas in same cell

    This is certainly the kind of problem I am familiar with. As Pepe suggested, a sample workbook with your exact requirements will help us give you specific advice.

    In general, here's how approach this problem:

    1) For the calculation/processing section of the spreadsheet, I will choose a unit system that I am comfortable with (usually SI). All the calculations in this section are based on those units.
    2) For the input section, I will let the user enter values and units using the available "from units" list for the CONVERT() function. http://office.microsoft.com/en-us/ma...551.aspx?CTT=1. Then I can use the CONVERT() function to convert from the user's input units to the units I used in the processing section.
    a) If I wanted this to be done by a single cell where the user inputs "unit system", I would create a lookup table where I could "define" the different unit systems I wanted to make available. An example of this kind of lookup table is at the end of the post. Then, a simple VLOOKUP() function http://office.microsoft.com/en-us/st...011.aspx?CTT=1 could be used to return the desired input and output units to the appropriate cells for each input/output value.
    3) For the output section, again, I will have the user select the desired output units from the available units for the CONVERT() function. From this text string, I can again use the CONVERT() function to convert the results of my calculation section into the user's desired units.
    4) The only additional thing I have done is that, since the CONVERT() function does not have a complete list of available units (especially for pressures), I created a UDF in VBA to expand the available units. This UDF is basically a collection of Select Case statements to perform the unit conversion.

    Example lookup table:
    Please Login or Register  to view this content.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Re: Recalculate using two different formulas in same cell

    Try this...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-18-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    67

    Question Re: Recalculate using two different formulas in same cell

    I have herein attached an excel file that describes my issue.
    I hope I was clear and informative enough in the excel file.
    Please read Sheets named as explanation and sheet 1 in the file.
    If any further info is req, please let me know.

    Sample.xlsx

    Quote Originally Posted by Pepe Le Mokko View Post
    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  6. #6
    Registered User
    Join Date
    10-18-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Recalculate using two different formulas in same cell

    Ya, my case is somewhat similar to that, except that, the input is not fixed to one single unit.
    the input may be in meters as well, and the user selects meters from the list if he gives input in meters
    so, both, the input and output must have a pick menu
    Quote Originally Posted by Xx7 View Post
    Try this...

  7. #7
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,289

    Re: Recalculate using two different formulas in same cell

    Try the function 'convert'
    For explanation :
    http://office.microsoft.com/en-nz/ex...010342306.aspx
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Recalculate using two different formulas in same cell

    its easy enough with convert i used lookup to get the correct abbr. for the function
    here is a sample drop downs in b2 and b5
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Re: Recalculate using two different formulas in same cell

    Quote Originally Posted by projectatpel View Post
    Ya, my case is somewhat similar to that, except that, the input is not fixed to one single unit.
    the input may be in meters as well, and the user selects meters from the list if he gives input in meters
    so, both, the input and output must have a pick menu
    Give this a try..
    Attached Files Attached Files

+ 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. Formulas will not recalculate and use blank cells to get to answer!!
    By Katecho in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-19-2013, 04:03 AM
  2. Replies: 2
    Last Post: 01-18-2011, 12:54 PM
  3. Clear values, save formulas; Recalculate
    By itsunclebill in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-21-2010, 06:38 PM
  4. how do I turn ON auto REcalculate for formulas if new data enter?
    By Mark in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-18-2006, 11:25 PM
  5. Big delay to recalculate formulas
    By LACA in forum Excel General
    Replies: 2
    Last Post: 01-11-2006, 08:20 PM

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