Consulting

Results 1 to 4 of 4

Thread: Use cell ref in table formula

  1. #1
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location

    Use cell ref in table formula

    I have the following formula:

    =SUMIF(Table1[Column1],A5,Table1[[#All],[Column2]])

    I would like the [Column2] part of the formula (Sum_range) to reference and use a cells value, example, if cell
    A10 = AnotherColumn
    I would like that in the formula.
    This would mean I can get the Sum_range part of the table formula to be dynamic.

    Thanks,

  2. #2
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi Marcster!
    Suppose the value of A10 cell is 3, this formula can summarize column3.
    =SUMIF(Table1[Column1],A5,INDIRECT("Table1[[#All],[Column"&A10&"]]"))

  3. #3
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Change #All to #Data, otherwise the result is wrong.

  4. #4
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location
    Thank you, spot on :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •