+ Reply to Thread
Results 1 to 4 of 4

INDIRECT Function problem

  1. #1
    Registered User
    Join Date
    07-23-2005
    Posts
    46

    INDIRECT Function problem

    Hi I am trying to use the indirect function -

    Here is my formula

    =SUM(INDIRECT('Data'!"AM"&B21&":AM"&G21))

    if I explicitly enter the row numbers into the formula it looks like this

    =SUM('Data'!AM292:AM298)

    but as B21 in the sheet containing the formula contains 292 and G21 contains 298 and these change I would like to use the INDIRECT function to return the sum and not have to alter the formula.

    I am sure it is the speech marks or the quotes I have wrong but I cant work out which ones. Anyones help much appreciated.

    Rob

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by robhargreaves
    Hi I am trying to use the indirect function -

    Here is my formula

    =SUM(INDIRECT('Data'!"AM"&B21&":AM"&G21))

    if I explicitly enter the row numbers into the formula it looks like this

    =SUM('Data'!AM292:AM298)

    but as B21 in the sheet containing the formula contains 292 and G21 contains 298 and these change I would like to use the INDIRECT function to return the sum and not have to alter the formula.

    I am sure it is the speech marks or the quotes I have wrong but I cant work out which ones. Anyones help much appreciated.

    Rob
    Hi,

    Try

    =SUM(INDIRECT("Data!AM"&B21&":AM"&G21))

    Let me know how you go
    ---
    Last edited by Bryan Hessey; 05-01-2007 at 07:30 PM.
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    07-23-2005
    Posts
    46
    Thanks I had to alter it a bit but it was nearly there... this is what i used...

    =SUM(INDIRECT("'Data'!AM"&$B$21&":AM"&$G$21))

    Rob

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by robhargreaves
    Thanks I had to alter it a bit but it was nearly there... this is what i used...

    =SUM(INDIRECT("'Data'!AM"&$B$21&":AM"&$G$21))

    Rob
    ok - not sure why you wouild need quote (') around a Sheetname that contains no spaces, but good to see that you have it working, and thanks for your response

    ---

+ 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