+ Reply to Thread
Results 1 to 6 of 6

Minimum distance between two numbers at all times (otherwise, please read, a tad complex?)

  1. #1
    Registered User
    Join Date
    04-15-2020
    Location
    Melton South, VIC, AU
    MS-Off Ver
    Office 365
    Posts
    12

    Question Minimum distance between two numbers at all times (otherwise, please read, a tad complex?)

    Good Afternoon All,

    First time post.

    I am building an excel program to make work life easier/quicker and all that good stuff.

    I will try to explain my aim as simply as possible (hopefully not confusing to all including myself!).

    First, I have a number in A1 638.75 (called a TRANSOM) and another number in A3 573 (called LINK)

    A1: 638.75 (TRANSOM)
    A3: 573 (LINK)

    Between those two numbers there must ABSOLUTELY be a minimum distance of 14.

    Example: 638.75-573=65.75

    But if it were say: 13, then A1 would be adjusted automatically by 1 make sure there is a distance of 14 at all times and A3 can never ever change.

    Example: 560 (A1)-573 (A3)=13 (< really wrong and bad)
    Example: 559 (A1)-573 (A3)=14 (< YaY, minimum achieved

    A1: Flexible
    A3: Can never change
    Requirement: Minimum 14 between A1 and A3 (with only A1 changing)

    How can I do this? I am at a complete loss.

    Please help?

    Thank you all for your help and time,
    - TwoCoffeeSnobs

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Minimum distance between two numbers at all times (otherwise, please read, a tad compl

    Hi, welcome to the forum

    If A1 is manually entered, then the only way to do what you want would be with VBA (coding). Otherwise if A1 contains a formula, we could probably adjust that formula to do what you want.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    04-15-2020
    Location
    Melton South, VIC, AU
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Minimum distance between two numbers at all times (otherwise, please read, a tad compl

    No formula at all.

    Just me adding two numbers to A1 and A3.

    Only VBA? I am not that good with it and still learning.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Minimum distance between two numbers at all times (otherwise, please read, a tad compl

    Yes, only VAB. A cell can either contain an entry (data) or a formula, not both.

    Another option might be to have a 3rd cell that would produce the adjusted value from A, taking into account the 14 diff rule

  5. #5
    Registered User
    Join Date
    04-15-2020
    Location
    Melton South, VIC, AU
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Minimum distance between two numbers at all times (otherwise, please read, a tad compl

    Option three would work, then I can show what it "was" meant to be and what it "has" to be.

    How would I go about this?

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Minimum distance between two numbers at all times (otherwise, please read, a tad compl

    Perhaps something like this?
    A
    B
    C
    1
    Trans Link Final
    2
    560
    573
    14
    3
    500
    573
    73
    4
    500
    515
    15

    C2=MAX(14,B2-A2)
    copied down

+ 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. Minimum Distance
    By Maddogwoof in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-06-2024, 12:33 AM
  2. [SOLVED] Minimum Distance Between Two Lat/Long Points
    By cas8100 in forum Excel General
    Replies: 3
    Last Post: 05-21-2021, 05:15 AM
  3. calculate the minimum distance between two sets of coordinates
    By ae711 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-11-2015, 03:09 AM
  4. [SOLVED] Getting the Minimum Distance (Formula Given)
    By dluhut in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-07-2013, 09:15 AM
  5. Replies: 3
    Last Post: 05-25-2012, 03:16 AM
  6. Calculate minimum distance between points
    By ciprian in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-08-2011, 04:01 PM
  7. Minimum distance between points
    By pmguerra in forum Excel General
    Replies: 16
    Last Post: 07-25-2009, 05:01 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