Consulting

Results 1 to 9 of 9

Thread: SUMIFS fomula

  1. #1
    VBAX Contributor Glaswegian's Avatar
    Joined
    Sep 2004
    Location
    Glasgow, Scotland
    Posts
    196
    Location

    SUMIFS fomula

    Hi

    I'm having a problem with a formula and could do with some help.

    I need to sum data in column F + data in column G, subject to specific criteria in Column D.

    The ranges in Columns F & G are named Debits and Debits3 respectively. These are dynamic ranges created using the following formula

    =OFFSET(Data!$G$1,0,0,MATCH(9.99999999999999E+307,Data!$G:$G),1)

    =OFFSET(Data!$F$1,0,0,MATCH(9.99999999999999E+307,Data!$F:$F),1)

    The criteria for column D is simply "<820000".

    My formula is

    =SUMIFS(Debits:Debits3,Bank,"<820000")

    but this produces a #VALUE! error.

    I'm not sure where I'm going wrong and would appreciate some guidance.

    Thanks.
    Last edited by Bob Phillips; 01-27-2015 at 04:40 AM. Reason: Disable smiles in text
    Iain - XL2010 on Windows 7

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It is probably different size ranges Iain. Try defining all of the counts for the dynamic ranges from the same source. I also found problems using the OFFSET formula so I used

    =Data!$G$1:INDEX(Data!$G:$G,MATCH(9.99999999999999E+307,Data!$G:$G))

    and

    =Data!$F$1:INDEX(Data!$F:$F,MATCH(9.99999999999999E+307,Data!$G:$G))


    for Debits and Debits3.

    And finally, you can't string the ranges together, so do it as 2 SUMIFS

    =SUMIFS(Debits,Bank,"<820000")+SUMIFS(Debits3,Bank,"<820000")
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor Glaswegian's Avatar
    Joined
    Sep 2004
    Location
    Glasgow, Scotland
    Posts
    196
    Location
    Hi xld

    Yes, when I step through the formula it's the 2 named ranges that show as the VALUE errors. I tried changing the OFFSET formula to your INDEX but I still get the VALUE error. I should have realised you could not add the ranges within the single formula!

    I can do this in parts (all calculations etc are done on a hidden sheet anyway) so I'm not overly worried that it does not work.

    Thanks again xld.
    Iain - XL2010 on Windows 7

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Did you change the Bank name definition as well?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Contributor Glaswegian's Avatar
    Joined
    Sep 2004
    Location
    Glasgow, Scotland
    Posts
    196
    Location
    I have now!

    However it looks like the Bank data may now be the issue - when evaluating the formula result that's the one that results in the VALUE error.

    Don't waste any more time one this - I can get around it.

    Appreciate your efforts, as always.
    Iain - XL2010 on Windows 7

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You can't say don't waste any more time Iain, I will fret all night

    Can you post the workbook so I can see what the cause is?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    VBAX Contributor Glaswegian's Avatar
    Joined
    Sep 2004
    Location
    Glasgow, Scotland
    Posts
    196
    Location
    Lol - sample now attached. The calculations are on the Totals sheet - the Data sheet contains the Named Ranges. I've removed the user forms and some sheets (mainly used for storing other data) and there is only dummy data in the workbook.

    Thanks again for your help.
    Attached Files Attached Files
    Iain - XL2010 on Windows 7

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    As I suspected, it was different size ranges. If you change the names as below, where the last row is determined from column A for each rather than from the column being defined, it works fine.

    Bank: =Data!$D$1:INDEX(Data!$D:$D,MATCH(9.99999999999999E+307,Data!$A:$A))

    Debits: =Data!$D$1:INDEX(Data!$D:$D,MATCH(9.99999999999999E+307,Data!$A:$A))

    Debites3: =Data!$D$1:INDEX(Data!$D:$D,MATCH(9.99999999999999E+307,Data!$A:$A))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  9. #9
    VBAX Contributor Glaswegian's Avatar
    Joined
    Sep 2004
    Location
    Glasgow, Scotland
    Posts
    196
    Location
    Hi xld

    That is just brilliant!

    Many thanks again.
    Iain - XL2010 on Windows 7

Posting Permissions

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