+ Reply to Thread
Results 1 to 4 of 4

2 questions

  1. #1
    Registered User
    Join Date
    10-12-2006
    Posts
    13

    2 questions

    Is it possible to make use a formula to find a certain type of data

    EG i have a massive list but im looking for a number that is closest to 1.7400

    the list ranges from 0.000 up to 2.0121 all the way back down to 0.000
    now all the numbers from 0.000 to 2.0121 are exactly the same to 2.0121 to 0.000

    The closest is 1.7425 now i need a formula to do this because some data will change so i need a general formula.

    The numbers Before and after it are 1.7362, 1.7394, 1.7425 (witch is the one i need), 1.7456, 1.7488
    My second question is in the same list i need a formula that can highlight that row. Is this possible?
    Last edited by Leprechaun; 12-11-2006 at 08:51 PM.

  2. #2
    Forum Contributor
    Join Date
    07-05-2006
    Location
    Canada
    MS-Off Ver
    2003, 2007
    Posts
    581
    My first thought is that you're saying two different things.

    In your statement, you're saying you want the closest value. However, in your example, you chose the smallest value larger than your target value.

    1.7400 - 1.7394 = 0.0006 <-- Closest
    1.7425 - 1.7400 = 0.0025

    Anyway, to find the closest, no matter which direction, use the following formula (an array formula):

    Please Login or Register  to view this content.
    I put the value sought for in B1, and the array in A1:A7... but you can adjust this.

    If you're trying to find the closest that is larger than the value you have, you can use the following formula:

    Please Login or Register  to view this content.
    To highlight this row (or rows), you have to put conditional formatting on the whole section (ie. A1:A7), comparing it to the cell where you have the value. (You can also use the formula directly) For example, if you put this formula in C1, you can just use conditional formatting and say "Cell Value" "is equal to" =$C$1.

    Note that if you are using decimal values, you might run into precision errors.

    Scott
    Last edited by Maistrye; 12-11-2006 at 11:17 PM.

  3. #3
    Registered User
    Join Date
    10-12-2006
    Posts
    13
    Well the First Thing i got to say is UHHHHHHHHHHHH....

    What i want is this

    I have 3600 Rows with data from Column A-F

    I need to find a certain Number. The Number I need out of these rows is in Column F.

    The Number i need to be close to is 1.7400 In all the 3600 Rows none match that number at all. But what i need is the number closest to it.
    These are the Rows Surrounding the number i need the formula to find

    Row - Number in Column F
    822 - 1.7362
    823 - 1.7394
    824 - 1.7425 <------This is the number i need the formula to find
    825 - 1.7456
    826 - 1.7488

    The reason i need that number is because its the first in the 1.7400 Range that comes up

    Now keep in mind when i change the data the Rows will or may not match so i need the formula to change to allways find the number closest to the one i specify.

  4. #4
    Forum Contributor
    Join Date
    07-05-2006
    Location
    Canada
    MS-Off Ver
    2003, 2007
    Posts
    581
    So, based on that, you need the first number that is greater than or equal to the number you specify, not just the closest number.

    If your data is not in sorted order, you'll have to use the formula I have above. (The second one, entered with CTRL+SHIFT+ENTER)

    There should be a different way to do it with them in sorted order, but off the top of my head... i can't think of it right now for some reason. Will continue to think about it and come back if I have an answer for you... or someone else may know it.

    Scott

+ 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