+ Reply to Thread
Results 1 to 5 of 5

Routine in order to obtain angles

  1. #1
    Registered User
    Join Date
    08-29-2019
    Location
    Lisbon, Portugal
    MS-Off Ver
    2020
    Posts
    8

    Question Routine in order to obtain angles

    Hello,
    I need somebodies help please.
    I want a routine that increments 0.05 degrees, each time, starting on 0.05, with a maximum value of 2PI , until we reach the closest value to Q2, wich is a variable that we already know its value.
    After reaching this value, I need the routine to give me the required value.
    The attached file is an arcaic manner of calculating the q(angle), the Q2 in highlighted in blue, the closest value is in green and the required value is in yellow.
    With this value I will be able to calculate the velocity of the flow rate of liquids.
    Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,463

    Re: Routine in order to obtain angles

    This formula will take the value from cell K2 and directly return the 1.85 that you want...

    =INDEX(D:D,MATCH(VLOOKUP(K2,H3:H129,1),H:H,0)+1,1)

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

    Re: Routine in order to obtain angles

    As noted in your newer thread, this looks like a root finding problem. One way to get roots in Excel is to use the built in Solver/Goal seek utilities https://support.office.com/en-us/art...B-F63E45925040 Here's how I might solve this using Solver in the example sheet in post #1:

    1) Columns D:I provide the calculation for Q (column H) from theta (column D). I would first make a copy of the bottom row and paste that in a few rows down. Select D129:I129 -> Copy -> Select D133 -> Paste
    2) Call Solver and tell it to:
    2a) Set target cell: H133
    2b) to a value of 210
    2c) by changing: D133
    3) Solve

    Excel comes back with a message that it could not find a solution, because the initial guess of 2PI was a very poor choice for the initial guess. Enter a better guess (1.5) into D133 and execute Solver again, and it quickly converges on the solution.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    08-29-2019
    Location
    Lisbon, Portugal
    MS-Off Ver
    2020
    Posts
    8

    Thumbs up Re: Routine in order to obtain angles

    Thank you Rick Rothstein but I'm looking for a (vba) routine that is capable of finding THETA using Q, I don't want to search the value in an excel's table.

  5. #5
    Registered User
    Join Date
    08-29-2019
    Location
    Lisbon, Portugal
    MS-Off Ver
    2020
    Posts
    8

    Thumbs up Re: Routine in order to obtain angles

    Thank you Mrshorty

+ 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] Excel 2016 Sort routine issue - recording macro has sheet name in sort routine
    By pongmeister in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-05-2016, 02:45 PM
  2. [SOLVED] naming a routine and calling it in another routine - not a loop
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2015, 11:54 AM
  3. [SOLVED] Order Form to Summarise Order on another sheet with a Submit Order Button
    By KazzICC in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-01-2014, 03:25 AM
  4. Pass a variable from one sub-routine to another sub-routine
    By gowtham_pec in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-01-2013, 07:07 PM
  5. obtain chronological order without sorting
    By Diamant in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-21-2012, 12:18 AM
  6. Using angles?
    By ekjeff in forum Excel General
    Replies: 3
    Last Post: 03-05-2011, 10:33 PM
  7. Angles
    By smartie123 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-09-2006, 08:55 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