+ Reply to Thread
Results 1 to 10 of 10

Data extraction from cells in a table that changes value based on a number.

  1. #1
    Registered User
    Join Date
    04-26-2010
    Location
    Bombay
    MS-Off Ver
    Excel 2003
    Posts
    17

    Data extraction from cells in a table that changes value based on a number.

    Hello everyone,

    Attached is a file called Calculator which performs some calculations based upon a value named Base and fills data into a table. The table is dynamic and changes with the base value.

    I have left empty columns to fill this base value into the table. The location of this number changes distinctly based upon the number input. The base number usually has 2 decimal digits. When the value for calculation is entered, the table value changes. The base number finds its spot in the table and gets highlighted using conditional formatting. Please enter numbers with 2 decimal places in H2 and see the changes.

    One striking pattern in this table is that each cell increases in value. And consequently, when the number slips into the table it has a bigger valued number on the right and a smaller valued number on the left.

    Now the problem is that I want two numbers from the right and two numbers from the left to be listed in cell f2,g2 for smaller and j2,k2 for the bigger number.

    Please help.

    It sounds complicated but is quite simple once the attachment is viewed.

    Thanking everyone.
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Data extraction from cells in a table that changes value based on a number.

    cant you just use
    =INT(Base)-1 and -2
    =INT(Base)+1 and +2
    ?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    04-26-2010
    Location
    Bombay
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Data extraction from cells in a table that changes value based on a number.

    Quote Originally Posted by martindwilson View Post
    cant you just use
    =INT(Base)-1 and -2
    =INT(Base)+1 and +2
    ?
    Yes certainly I could use that but the formulae are a little more complex than shown. It involves reducing/increasing numbers after taking square roots, by certain percent and then re-squaring etc. I have just shown a simple version of the formula to be used and as an example.

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

    Re: Data extraction from cells in a table that changes value based on a number.

    Assuming the values being returned are always numbers then perhaps:

    F2: =LARGE(IF($B$6:$R$36<$H$2,$B$6:$R$36),2-(COLUMNS($F2:F2)-1))
    confirmed with CTRL + SHIFT + ENTER
    copied to G2

    J2: =SMALL(IF($B$6:$R$36>$H$2,$B$6:$R$36),COLUMNS($J2:J2))
    confirmed with CTRL + SHIFT + ENTER
    copied to K2

  5. #5
    Registered User
    Join Date
    04-26-2010
    Location
    Bombay
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Data extraction from cells in a table that changes value based on a number.

    Quote Originally Posted by DonkeyOte View Post
    Assuming the values being returned are always numbers then perhaps:

    F2: =LARGE(IF($B$6:$R$36<$H$2,$B$6:$R$36),2-(COLUMNS($F2:F2)-1))
    confirmed with CTRL + SHIFT + ENTER
    copied to G2

    J2: =SMALL(IF($B$6:$R$36>$H$2,$B$6:$R$36),COLUMNS($J2:J2))
    confirmed with CTRL + SHIFT + ENTER
    copied to K2
    Thanks a lot for your help

  6. #6
    Registered User
    Join Date
    04-26-2010
    Location
    Bombay
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Data extraction from cells in a table that changes value based on a number.

    Yes they are all numbers, but the formula you mentioned does not seem to work. It gives the #value! error. Kindly advise.

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

    Re: Data extraction from cells in a table that changes value based on a number.

    Did you commit the formulas as Arrays ? (ie with CTRL + SHIFT + ENTER not just Enter).

    If so, and you're still having problems, post a sample with formulae in place which illustrates as such.

  8. #8
    Registered User
    Join Date
    04-26-2010
    Location
    Bombay
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Data extraction from cells in a table that changes value based on a number.

    Quote Originally Posted by DonkeyOte View Post
    Did you commit the formulas as Arrays ? (ie with CTRL + SHIFT + ENTER not just Enter).

    If so, and you're still having problems, post a sample with formulae in place which illustrates as such.
    Yes I did it couple of times. Attached is the updated file.

    Thanks a lot for helping out.
    Attached Files Attached Files

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

    Re: Data extraction from cells in a table that changes value based on a number.

    None have been entered as Arrays.

    To reiterate - when you commit the formula you must do so with CTRL + SHIFT + ENTER not just Enter as you would "normally".

  10. #10
    Registered User
    Join Date
    04-26-2010
    Location
    Bombay
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Data extraction from cells in a table that changes value based on a number.

    Quote Originally Posted by DonkeyOte View Post
    None have been entered as Arrays.

    To reiterate - when you commit the formula you must do so with CTRL + SHIFT + ENTER not just Enter as you would "normally".
    Oh Ok. Thanks it worked very well.

    Am sincerely grateful.

+ 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