+ Reply to Thread
Results 1 to 10 of 10

OFFSET func dynamic "reference"

Hybrid View

  1. #1
    Registered User
    Join Date
    07-03-2007
    Posts
    8

    OFFSET func dynamic "reference"

    Hi, guys!
    I have the following issue to solve:
    I'd like to have a dynamic "reference" step for OFFSET function - unfortunately when I put vlookup there, the formula doesn't want to work.

    Here you are examples:
    1. =SUM(OFFSET(Actual!D125,0,0,1,$D$1),VLOOKUP($D12,Actual!$C$6:$O$597,2)) - this is working, as you can see the underlined references gives to the OFFSET the cell as reference

    but when i try to make it dynamic...

    2. =SUM(OFFSET(VLOOKUP($D12,Actual!$C$6:$D$597,2,0),0,0,1,$D$1),VLOOKUP($D12,Actual!$C$6:$O$597,2)) - here I replaced the single cell reference from previous example with the underlined one here and formula is not working.

    Please, help me on this thing...

  2. #2
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    what does VLOOKUP($D12,Actual!$C$6:$D$597,2,0) return

    the first arguement of the offset needs to be a cell. if the value of the lookup is say a cell address try

    indirect(VLOOKUP($D12,Actual!$C$6:$D$597,2,0))

    Regards

    Dav

  3. #3
    Registered User
    Join Date
    07-03-2007
    Posts
    8
    Yes, I've tried INDIRECT - it returns #ref...

    The problem is that the VLOOKUP returns the cell content and this mixed up the OFFSET function.. I need a way that VLOOKUP returns me the cell aws reference (for instance D125)... then it will works...

  4. #4
    Registered User
    Join Date
    07-03-2007
    Posts
    8
    Is there somebody with any ideas regarding my concern???

  5. #5
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    well you need to find which bit of the formual is not working, If you select a bit of the formula and press f9 it returns the value of that bit evaluated. If you do this for bits of the formual, you can see where the error originates

    =SUM(OFFSET(VLOOKUP($D12,Actual!$C$6:$D$597,2,0),0,0,1,$D$1),VLOOKUP($D12,Actual!$C$6:$O$597,2))

    I would first do the following steps
    1 ) what is the value of $d$1 , it should be a number >0
    2) what does VLOOKUP($D12,Actual!$C$6:$D$597,2,0) return, ? what do you want it to return
    3) does VLOOKUP($D12,Actual!$C$6:$O$597,2) return a value?

    Why not attach a small zipped version of the sheet so we can see what u want to do

    Regards

    Dav

  6. #6
    Registered User
    Join Date
    07-03-2007
    Posts
    8
    Hi, Dav!
    Thanks for your writing...!

    Right now I cannot attach a sheet (maybe later).

    The general idea is to make a YTD sum cell with two variables - month and cost center.
    1. $d$1 is number between 1 and 12 and it says to OFFSET [width] how many cells to include in the sum - here I use for monthly variable and it works

    2. VLOOKUP($D12,Actual!$C$6:$D$597,2,0) is returning me the cell value (some number), but I want to retrieve the cell reference (D125) and not the value - if I succeed to retrieve this, then OFFSET function will now which cell to use as starting point - actually here I look for the cost center number to match it with the row where I want to get YTD

    3. Yes, VLOOKUP($D12,Actual!$C$6:$D$597,2,0) returns a value as I wrote in point 2, but I need the cell and not the value...

+ 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