+ Reply to Thread
Results 1 to 3 of 3

How to find the nearest value of A from within C and place a copy of that value in B?

  1. #1
    Registered User
    Join Date
    09-02-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    1

    Question How to find the nearest value of A from within C and place a copy of that value in B?

    this may sound dull to you experts but i have no expertise whatsoever in Excel and am hoping you can help me..

    I have the following:

    COLUMN A (A1:A100) FULL OF VALUES

    COLUMN B (B1:B100) EMPTY

    And COLUMN C (C1:C30) FULL OF VALUES

    I am trying to do the following:

    To find the nearest value to A1 from within C1:C30 and then copy that nearest value (a value coming from C1:C30 that is nearest to A1)into B1 and so forth until B100..
    ----- I am sorry if i didn't explain it clearly but please let me know if so..

    For Example:

    1- if A1=6 and C1:C3=1,2,5;

    2- The nearest numerical value to A1 would be 5

    3- 5 would be placed in B1

    thanks in advance
    Last edited by thefunkybadbos; 09-02-2014 at 06:32 PM. Reason: added an example

  2. #2
    Registered User
    Join Date
    11-25-2013
    Location
    Western Australia
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: How to find the nearest value of A from within C and place a copy of that value in B?

    I believe a VLOOKUP is what you're after. However, this is only going to work if column C is sorted from lowest to highest number.

    I've attached an example spreadsheet to show how this works. If you take a look at the formula in B2, it is =VLOOKUP(A2,C:C,1,TRUE) - what this means is
    • A2 - this is what you're looking for
    • C:C - this is where you're looking
    • 1 - this means to return a value from the first of the columns you're looking in (C:C is only one column so this must be 1)
    • TRUE - means return the nearest match. A2 contains the number 20. The formula will look in column C for that number. If found, it will return 20. If not found, as soon as it finds a number higher than 20 it will return the value in the previous row (19). If the formula said FALSE then you'd get an error, because 20 does not appear in the list.

    I hope this helps.
    Attached Files Attached Files

  3. #3
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: How to find the nearest value of A from within C and place a copy of that value in B?

    Try,

    First one will choose the nearest value higher than A2 & Second one will choose nearest value lower than A2

    Both were array formulas need to be entered with CTRl+SHIFT+ENTER and drag it down

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click just below left if it helps, Boo?ath?

+ 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. Range.Find to find column and place value in next available cell in one line
    By davegugg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2011, 10:41 AM
  2. Find nearest highest value
    By kborgers in forum Excel General
    Replies: 9
    Last Post: 11-11-2010, 06:53 AM
  3. macro: take valu, find it in sheet2, copy row to sheet1 in right place
    By crazedraven in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-24-2009, 10:26 AM
  4. Find nearest value
    By Two-Canucks in forum Excel General
    Replies: 7
    Last Post: 05-19-2006, 02:55 PM
  5. find nearest help
    By nobbyknownowt in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-21-2006, 08:40 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