+ Reply to Thread
Results 1 to 7 of 7

OFFSET Question

  1. #1
    Registered User
    Join Date
    09-22-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2003
    Posts
    4

    OFFSET Question

    Short version

    This code returns a cell reference correctly:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And this hard-code OFFSET works as expected: ($A$4 was returned by the formula above)

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However, when I combine the two code snippets,

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I receive a dialog box that says [ " the formula you have entered contains an error " ]

    Any suggestions/direction would be much appreciated!!

    -----------------------------------
    Long Version / Details

    My data consists of a set of numbers for each day of the week (M-F) and they are populated in rows.

    Here's some sample data-

    HTML Code: 
    Each week I insert another 5 rows and manually populate these values.
    All of this is on sheet1

    Sheet 2 pulls some values from the 5 rows (M-F).
    I would like to have sheet 2 be able to determine the most recent week and return data from the correct set of 5 rows.
    I populated a cell in COL A with the ending date, for example 09/21/2012 -- one row above the daily data rows
    And then used a function to find the cell reference of the most recent(largest) Date in COL A.

    This formula returns $A$4 (before A10 was populated..)
    Please Login or Register  to view this content.
    When I populate A10 with 09/28/2012 it returns $A$10. There is surely a less verbose way of doing this, but it seems to work..

    When I *hard-code* a reference in the OFFSET function, it appears to return the correct value. Example, these both return "45", which is the value in C5 (again, without A10's new date)

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    However, when I substitute the hard-coded REFERENCE parm ("$A$4") with the formula that returns "$a$4 like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I receive a dialog box that says [ " the formula you have entered contains an error " ]. I don't know anything about Excel (perl programmer..)

    How do I trace down the incompatibility (ies)?

    TIA,
    Mark

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: OFFSET Question

    try taking the = out before "cell"
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-22-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: OFFSET Question

    =OFFSET(CELL("address",INDEX(A:A,MATCH(MAX(A:A),A:A,0))),1,2,1,1)

    Still returns "The formula you typed returns an error". Thanks for the help.. any other suggestions welcome!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: OFFSET Question

    ok, i didnt test it, sorry, just saw the =cell. what are you trying to achieve with this? if i leave off the =offset() and just use =CELL("address",INDEX(A:A,MATCH(MAX(A:A),A:A,0),1)) it gives me $A$4.

    maybe upload a sample workbook showing what you have, what you expect, and how you arrive at that

  5. #5
    Registered User
    Join Date
    09-22-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: OFFSET Question

    I have uploaded a small workbook with some data and formulas. (working and non-working..)

    Marvelous that you have a moment to look at it!

    Thanks

  6. #6
    Registered User
    Join Date
    09-22-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: OFFSET Question

    Here's the sample data workbook
    Attached Files Attached Files

  7. #7
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: OFFSET Question

    Try..

    Please Login or Register  to view this content.
    or without the height and width reference
    Please Login or Register  to view this content.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

+ 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