+ Reply to Thread
Results 1 to 9 of 9

OFFSET FUNCTION: Syntax or a missing Formula:

  1. #1
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    106

    Angry OFFSET FUNCTION: Syntax or a missing Formula:

    =OFFSET( CONCATENATE( "C", MATCH("United Kingdom",$A:$A, 0)) , 0 , 0 , COUNTIF(A:A, "=United Kingdom"), 1)

    The aim here is to "construct" a cell reference for the OFFSET Function. I.E Our column is always C, but our MATCH function outputs varying row numbers:

    we want a formula that takes a fixed column, a MATCH output number and generates a cell reference from them. I think the problem here is the OFFSET function is not reading the reference here as its text.

    Is there another approach to this?

    Regards,

    Koto

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,462

    Re: OFFSET FUNCTION: Syntax or a missing Formula:

    You can use INDEX to return a reference to a cell or a range which can be used directly in another formula/function

  3. #3
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: OFFSET FUNCTION: Syntax or a missing Formula:

    Quote Originally Posted by Pepe Le Mokko View Post
    You can use INDEX to return a reference to a cell or a range which can be used directly in another formula/function
    =OFFSET( INDEX($A:$A,MATCH("United Kingdom",$A:$A, 0), 3), 0, 0, COUNTIF(A:A, "=United Kingdom"), 1)

    tried this, but i'm getting REF! error

  4. #4
    Forum Contributor
    Join Date
    11-05-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    229

    Re: OFFSET FUNCTION: Syntax or a missing Formula:

    You could use the INDIRECT function. It takes a text string, and converts into a cell reference.
    Your formula would become:

    =OFFSET( INDIRECT(CONCATENATE( "C", MATCH("United Kingdom",$A:$A, 0))) , 0 , 0 , COUNTIF(A:A, "=United Kingdom"), 1)

  5. #5
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: OFFSET FUNCTION: Syntax or a missing Formula:

    =OFFSET( INDIRECT(ADDRESS(MATCH("United Kingdom",$A:$A, 0), 3)), 0, 0, COUNTIF(A:A, "=United Kingdom"), 1)


    I'm happy with this, approach... all formulae are evaluating correctly within the OFFSET, but its saying error!

    any suggestions?

    Is it because address outputs text?
    Last edited by niceguy21; 11-05-2012 at 02:06 PM.

  6. #6
    Forum Contributor
    Join Date
    11-05-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    229

    Re: OFFSET FUNCTION: Syntax or a missing Formula:

    yes, you'll still need to use the INDIRECT formula.
    Also, if you are using the OFFSET formula in a cell and the formula is returning a range instead of a single cell, Excel will give you an error.

  7. #7
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: OFFSET FUNCTION: Syntax or a missing Formula:

    Quote Originally Posted by TheExcelphile View Post
    yes, you'll still need to use the INDIRECT formula.
    Also, if you are using the OFFSET formula in a cell and the formula is returning a range instead of a single cell, Excel will give you an error.
    gotcha^^ I though it would neatly output a cell range for me

  8. #8
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: OFFSET FUNCTION: Syntax or a missing Formula:

    Quote Originally Posted by TheExcelphile View Post
    yes, you'll still need to use the INDIRECT formula.
    Also, if you are using the OFFSET formula in a cell and the formula is returning a range instead of a single cell, Excel will give you an error.
    gotcha^^ I though it would neatly output a cell range for me

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,462

    Re: OFFSET FUNCTION: Syntax or a missing Formula:

    Quote Originally Posted by niceguy21 View Post
    =OFFSET( INDEX($A:$A,MATCH("United Kingdom",$A:$A, 0), 3), 0, 0, COUNTIF(A:A, "=United Kingdom"), 1)

    tried this, but i'm getting REF! error
    Suggest you read this on what INDEX really does

+ 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