+ Reply to Thread
Results 1 to 5 of 5

Incremental hlookup

  1. #1
    Registered User
    Join Date
    03-28-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    2

    Incremental hlookup

    Hello All

    I was wondering if you could help me solve a quick problem I'm having. I have a spreadsheet as follows:

    1 | 2 | 3 | 4 | 5 | 6
    2.50 | 0.50 | 0.75 | 1.00 | 1.25 | 2.50

    Say I entered "3" into a cell it would look up "0.75" but also add the cells before it so the total would be "2.50" + "0.50" + "0.75" = 3.75

    Again, if I was to enter "5" into a cell it would look up "1.25" but also add the cells before etc to give me 6.00.

    Is this possible at all?

    Many thanks in advance...
    Last edited by NBVC; 05-06-2011 at 03:50 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,047

    Re: Incremental hlookup

    here, try this:

    =SUMIF(A1:E1,"<="&H1,A2:E2)
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    03-28-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Incremental hlookup

    Perfect!!! Thank you so much!

  4. #4
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Incremental hlookup

    Or if your lookup numbers are not sequential, then:

    =SUM(A2:INDEX(A2:F2,1,MATCH(A4,A1:F1,0)))

    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

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

    Re: Incremental hlookup

    or even with values in b1 to z1
    =SUM(B1:INDEX(B1:Z1,1,A1))
    and put the number you want summed in a1
    "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

+ 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