+ Reply to Thread
Results 1 to 11 of 11

Formula to find the closest value?

  1. #1
    Registered User
    Join Date
    04-26-2007
    Posts
    37

    Formula to find the closest value?

    I am working on payment/cost estimator and am looking for some ideas and formula or macro help. Basically what I am trying to do is set up a calculator where you would input the payment you could afford and it will tell you how much you can spend on the equipment.
    The problems I am running into are that when you factor in the interest rate and commission, the payments are round numbers so I need the formula to find the closest value.
    Example- $250 payment. The payments in the table w/ the interest rates are $158, $248 and $350. I would need it to pick the corresponding equipment cost for the $248 payment.

    Make sense?
    If a macro would be easier I am fine with that, just have limited experience setting one up. TIA!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Formula to find the closest value?

    Maybe like this:
    Please Login or Register  to view this content.
    The formula in B1 is =INDEX(A3:A5, MATCH(MIN(ABS(A3:A5-A1)), ABS(A3:A5-A1) ), 0), confirmed with Ctrl+Shift+Enter.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-26-2007
    Posts
    37

    Re: Formula to find the closest value?

    I tried to rearrange my payment table to correspond with that formula and can't make it work. Any other ideas or thoughts?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Formula to find the closest value?

    Yes -- post a workbook.

  5. #5
    Registered User
    Join Date
    04-26-2007
    Posts
    37

    Re: Formula to find the closest value?

    Attached is a sample workbook.

    Ideally, the formula should take the value from A2 (payment amount), find the closest value from the range and input the corresponding equipment cost in A4.

    THanks.
    Attached Files Attached Files

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Formula to find the closest value?

    =INDEX(E2:E15, MATCH(MIN(ABS(E2:E15-A2)), ABS(E2:E15-A2), 0) ), confirmed with Ctrl+Shift+Enter

  7. #7
    Registered User
    Join Date
    04-26-2007
    Posts
    37

    Re: Formula to find the closest value?

    Okay this is to bump this thread since I have not been able to make the formula I was given work.

    I am trying make a calculator that will find the corresponding equipment cost based on the payment selected. There are multiple components to this, but part I am having trouble with is getting the payment the customer would enter to match the closest payment according to the range. Thanks.

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to find the closest value?

    The formula provided will work but you need to revise the first range from E2:E15 to D2:D15 if you wish to return Equipment Cost associated with closest match of payment amount.
    (remember you must commit the formula with CTRL + SHIFT + ENTER)

  9. #9
    Registered User
    Join Date
    04-26-2007
    Posts
    37

    Re: Formula to find the closest value?

    Okay, what am I missing? I copied and pasted the formula from the post, changed the range you specified, and still get #N/A

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to find the closest value?

    I suspect the text in my post coloured red ... (for effect!)

  11. #11
    Registered User
    Join Date
    07-03-2010
    Location
    Egypt
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Formula to find the closest value?

    yes its worked with me
    thanks thanks
    i found this subject when i search in Google
    and that i really want

+ 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