+ Reply to Thread
Results 1 to 9 of 9

Indirect reference within SUMPRODUCT & LEFT

  1. #1
    Registered User
    Join Date
    06-01-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    13

    Indirect reference within SUMPRODUCT & LEFT

    Hi,

    need urgent help.

    currently I am using the following formula which works perfectly fine:

    =SUMPRODUCT((LEFT(Jan!$P$9:$P$3000,6)=$F124)*(Jan!$T$9:$T$3000))

    However, I would need to make an indirect reference to the Worksheet "Jan" instead of the reference above. The Text "Jan" is in Cell P7 of the same worksheet as the formula above. I can't get the INDIRECT formula right with the SUMPRODUCT and the LEFT condition above.

    Anyone able to help me here?

    Thanks in advance

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Indirect reference within SUMPRODUCT & LEFT

    Try this version with SUMPRODUCT

    =SUMPRODUCT((LEFT(INDIRECT(P7&"!P9:P3000"),6)=$F124)*INDIRECT(P7&"!T9:T3000"))

    ....or it's possibly simpler to use SUMIF with a "wildcard" like this

    =SUMIF(INDIRECT(P7&"!P9:P3000"),$F124&"*",INDIRECT(P7&"!T9:T3000"))
    Audere est facere

  3. #3
    Registered User
    Join Date
    06-01-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    13

    Re: Indirect reference within SUMPRODUCT & LEFT

    Thanks, However, I get a #REF! error with both solutions.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Indirect reference within SUMPRODUCT & LEFT

    Both work OK when I tested - is the sheet name just "Jan"? iS that in P7

  5. #5
    Registered User
    Join Date
    06-01-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    13

    Re: Indirect reference within SUMPRODUCT & LEFT

    Yes, sheet name is "Jan" & the text "Jan" is in P7.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Indirect reference within SUMPRODUCT & LEFT

    The formula I suggested should work, are you sure P7 is text and not a formatted date? Can you post a sample workbook showing the problem?

  7. #7
    Registered User
    Join Date
    06-01-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    13

    Re: Indirect reference within SUMPRODUCT & LEFT

    Ok...somehow it must have to do with P7. I have another INDIRECT formula in one of the other sheets that is also referencing "Jan". I copied that cell (which contains only the text "Jan") into P7 and your proposal works (thanks!). Now I am just curious why.What was wrong with P7's "Jan" before? any ideas? there was no blank or any misspelling there (after all its only 3 letters).

  8. #8
    Registered User
    Join Date
    06-01-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    13

    Re: Indirect reference within SUMPRODUCT & LEFT

    Quote Originally Posted by daddylonglegs View Post
    The formula I suggested should work, are you sure P7 is text and not a formatted date? Can you post a sample workbook showing the problem?
    Maybe that was the reason!!!!

    Thanks a lot - it works!!!

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Indirect reference within SUMPRODUCT & LEFT

    This version will will either way, if P7 contains the text "Jan" or a January date

    =SUMPRODUCT((LEFT(INDIRECT(TEXT(P7,"mmm")&"!P9:P3000"),6)=$F124)*INDIRECT(TEXT(P7,"mmm")&"!T9:T3000"))

+ 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