+ Reply to Thread
Results 1 to 3 of 3

Thread: INDIRECT with two conditions in SUMIF

  1. #1
    Registered User
    Join Date
    08-30-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    17

    INDIRECT with two conditions in SUMIF

    Hi

    I've had success using this formula...

    =SUMIF(INDIRECT($A3&"!CCY"),C$1,INDIRECT($A3&"!Value"))

    where

    A3 = sheet name (to link to another tab)
    C1 = specified currency code eg USD
    CCY = range specified in each tab relating to currency codes (eg USD)
    Value = range specified in each tab relating to monetary values

    The result successfully matches my chosen currency in cell C1 and sums the values of every occurrence of the currency in my chosen sheet.

    BUT I want to extend this to add in another condition. I want to be able to link another condition using the indirect function which relates to a Buy ("B") or Sell ("S") tag which is also specified in each sheet. Hence I want to be able to say IF(INDIRECT($A3&"!BUY_SELL")="B") then do the summation for related the values for that currency.

    I've attached a workbook to hopefully clarify things and have tried to set out what I need my summary sheet to look like.

    Any suggestions welcome. I'd prefer to avoid pivot tables as the desire is to link to sheets which are copied in from other sources and need to be kept separated by date.

    Thanks
    Attached Files Attached Files
    Last edited by JXH; 09-01-2011 at 12:58 AM.

  2. #2
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: INDIRECT with two conditions in SUMIF

    Hello,

    create another range per sheet,

    BuySell ='30Aug2011'!$D:$D

    Then you can use

    =SUMPRODUCT(--(INDIRECT($A2&"!CCY")=C$1),--(INDIRECT($A2&"!BuySell")="S"),INDIRECT($A2&"!Value"))

    But using Sumproduct with whole columns is not a good idea. You should limit the range names per sheet to only the populated rows.

    Have a look at dynamic range names for that.

    cheers,

  3. #3
    Registered User
    Join Date
    08-30-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: INDIRECT with two conditions in SUMIF

    Thanks teylyn.

    I had tried the -- sumproduct method but couldn't work out why I was getting an error but given your post looks like it was down to using whole columns! Cuting the ranges down to just the cells with data worked a treat.

    I'll definitely be trying out the dynamic range names when I get a chance as think that sounds perfect for what I'm after - will no doubt end up needing some help on those too though

    Thanks again for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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.2.0