+ Reply to Thread
Results 1 to 9 of 9

which value is closer

  1. #1
    Registered User
    Join Date
    12-02-2016
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    73

    which value is closer

    I have four columns. One has an account value. associated with each account is an amount column. Sometimes there are three accounts sometimes two. Then to the right is a column that contains a new value. I need to find which of the original amount value is closer to the new value.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-02-2016
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    73

    Re: which value is closer

    there can actually be many acounts not just 2-3.

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: which value is closer

    Here's my shot at it using a UDF.

    =IsCloser(Account, Target Value, Account Range, Amount Range)
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  4. #4
    Registered User
    Join Date
    12-02-2016
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    73

    Re: which value is closer

    When i tried that i got a #NAME?. Any suggestions?

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: which value is closer

    Account and target value should be single cells and Account Range and Amount range should be actual ranges on the worksheet like so:
    =IsCloser(F2,H2,$F$2:$F$8,$E$2:$E$8)

  6. #6
    Registered User
    Join Date
    12-02-2016
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    73

    Re: which value is closer

    ya i have it set up like that. Even when I look at the example you posted it still has #NAME?

  7. #7
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: which value is closer

    I don't know what to tell you. When I open the workbook, it works. The only reason to get a #NAME error is if excel doesn't know of the function name or the name of one (or more) of the parameters. I don't think that if you fail to enable macros you would get a #NAME error - you would get some other kind of error.

  8. #8
    Registered User
    Join Date
    12-02-2016
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    73

    Re: which value is closer

    I see. I am on excel 2010 so that might make a difference. When I first look at your example it looks to be working. But when i enable editing it switches to #NAME?

  9. #9
    Registered User
    Join Date
    12-02-2016
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    73

    Re: which value is closer

    Also i was not using any macros. should I?

+ 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. Replies: 8
    Last Post: 07-07-2016, 05:22 PM
  2. [SOLVED] Which program is closer to vba programming?
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-09-2015, 08:22 AM
  3. [SOLVED] Find the date closer to another with a condition
    By tsakta13ole in forum Excel General
    Replies: 11
    Last Post: 05-22-2015, 08:29 AM
  4. Automatic mail on due date (30 days or closer)
    By medioman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2012, 05:32 AM
  5. Find closer higher value
    By caquico in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2010, 08:51 PM
  6. I'm getting closer, one more part
    By abmyers in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-02-2007, 04:33 PM
  7. labels closer to axis
    By Meaghan in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-29-2006, 12:45 PM

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