+ Reply to Thread
Results 1 to 8 of 8

Check to see if cell is closer than another cell

  1. #1
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Check to see if cell is closer than another cell

    I need to put a formula in cell H9 that does the following


    if cell F9 is closer to cell G5 than cell F8 than = "Yes" else "NO"

    Example:
    G5 = 429
    F8 = -696
    F9= -200
    Result = "YES"

    Example:
    G5 = 429
    F8 = 431
    F9= 418
    Result = "NO"

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Check to see if cell is closer than another cell

    Try

    =IF((F9-G5) < (F9-F8),"Yes","No")
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Check to see if cell is closer than another cell

    Try this in H9:

    =IF(ABS(G$5-F9)<ABS(G$5-F8),"yes","no")

    Hope this helps.

    Pete

  4. #4
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Check to see if cell is closer than another cell

    Please Login or Register  to view this content.
    If someone has helped you then please add to their Reputation

  5. #5
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: Check to see if cell is closer than another cell

    Thank you so much. Pete and pjwhitfield worked in every trial.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Check to see if cell is closer than another cell

    Thanks for marking the thread as SOLVED.

    You might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  7. #7
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Check to see if cell is closer than another cell

    Quote Originally Posted by Pete_UK View Post
    Thanks for marking the thread as SOLVED.

    You might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete
    As I have just done for yours seeing as you reminded me of the much easier ABS function than my longwinded convert to positive malarky!

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Check to see if cell is closer than another cell

    Thanks for the rep.

    Pete

+ 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] Check one cell, check second cell, return relevant value
    By NeroM in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-19-2014, 10:00 AM
  2. check cell for specific state initials, display sales rep name in another cell
    By aChocolateCake in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-13-2013, 10:33 PM
  3. [SOLVED] check if number in once cell exists in a range of cells and if yes, format another cell
    By beaujolais44 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-16-2013, 07:23 AM
  4. Macro to check for blank cell entry, copy previous value, and check for duplicates
    By xPunxNotDeadx in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-26-2009, 06:33 PM
  5. [SOLVED] Moving display of comments closer to parent cell
    By achidsey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2005, 10:05 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