+ Reply to Thread
Results 1 to 13 of 13

Excel 2007 : CSE Array Formula doesn't work

  1. #1
    Registered User
    Join Date
    12-02-2010
    Location
    Huntington, New York, USA
    MS-Off Ver
    Excel 2007
    Posts
    20

    CSE Array Formula doesn't work

    Hi All:

    In the attached workbook I would like to sum the Hours ('Database'!Hours) expended in each Category ('Database'!Category) between the dates entered in cells 'Summary'!A1 and 'Summary'!B1. The data is located on a Database sheet and the formula on a Summary sheet (Summary!Hours). I am barred from using the SUMIFS function which would make life too easy. Naming the ranges didn't change anything so I am up a tree.

    My CSE formula, for cell b4 on the Summary sheet is {=IF(AND(A4=Database!B:B,Database!A:A>=A1,Database!A:A<=B1),SUM(Database!C:C))} entered properly using Ctrl-Shift-Enter. The formula returns FALSE while I expect it to return 9 ... the number of hours in Category A between the dates of 1/5/2011 and 1/10/2011 inclusive.

    Can anyone help?

    Thanks for trying,

    Stosh
    Attached Files Attached Files
    Last edited by srschiller; 11-17-2011 at 04:36 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: CSE Array Formula doesn't work

    Try:

    =SUMIFS(Database!C:C,Database!B:B,A4,Database!A:A,">="&A$1,Database!A:A,"<="&B$1)

    copied down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    12-02-2010
    Location
    Huntington, New York, USA
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: CSE Array Formula doesn't work

    Sorry ... I am barred from using the SUMIFS function. Can you do it without SUMIFS?

    Stosh

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: CSE Array Formula doesn't work

    Why are you barred... what software are you using?

    can you use helper columns?

  5. #5
    Registered User
    Join Date
    12-02-2010
    Location
    Huntington, New York, USA
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: CSE Array Formula doesn't work

    Actually, the database is on Google Docs ... which does not support SUMIFS. So the gauntlet has been thrown! Can you do it without SUMIFS?

    I can add other columns to either sheet.
    Last edited by srschiller; 11-17-2011 at 03:35 PM.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: CSE Array Formula doesn't work

    There's Sumproduct:

    =SUMPRODUCT(Database!C:C,--(Database!B:B=A4),--(Database!A:A>=A$1),--(Database!A:A<=B$1))

    but it is not recommended to use whole columns with this function....

  7. #7
    Registered User
    Join Date
    12-02-2010
    Location
    Huntington, New York, USA
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: CSE Array Formula doesn't work

    Quote Originally Posted by NBVC View Post
    There's Sumproduct:

    =SUMPRODUCT(Database!C:C,--(Database!B:B=A4),--(Database!A:A>=A$1),--(Database!A:A<=B$1))

    but it is not recommended to use whole columns with this function....
    Interesting approach and SUMPRODUCT is supported, however it returns an incorrect answer. Could it be multiplying (product?) instead of adding ?

    I can't figure our why my original formula, {=IF(AND(A4=Database!B:B,Database!A:A>=A1,Database!A:A<=B1),SUM(Database!C:C))}, doesn't work ... it returns "FALSE".

    BTW, I like your stylized Triceratops ... or is your avatar a different dinosaur?
    Last edited by srschiller; 11-17-2011 at 03:57 PM.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: CSE Array Formula doesn't work

    If you want an array formula similar to what you have try:

    =SUM(IF((A4=Database!B:B)*(Database!A:A>=A1)*(Database!A:A<=B1),(Database!C:C)))

    confirmed with CTRL+SHIFT+ENTER or whatever google makes you do... again whole columns might not work with that either.


    It is actually a Styrocasaurus.... my son is in to dinosaurs and knows quite a bit of them

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: CSE Array Formula doesn't work

    It seems Google wants an ArrayFormula prefix

    e.g.

    =ArrayFormula(SUM(IF((A4=Database!B:B)*(Database!A:A>=A1)*(Database!A:A<=B1),(Database!C:C))))

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

    Re: CSE Array Formula doesn't work

    I believe you can type in the ArrayFormula part or use CSE just like in Excel and it adds that (and the parentheses) automatically.

    SUMPRODUCT works in Google docs but you can't use it for multiconditional counting as it's often used in Excel, only for manipulating numbers
    Audere est facere

  11. #11
    Registered User
    Join Date
    12-02-2010
    Location
    Huntington, New York, USA
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: CSE Array Formula doesn't work

    Yes ... Google docs does support CSE formulae - thanks.

    NVBC ... interesting that your last try using SUMIF returns the same (incorrect) results as the one using SUMPRODUCT. For Categories A,B,C I am getting 25,33,152 respectively ... which I can't correlate to anything. The correct returns should be 9, 20, 1. Are these results just erratic?

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

    Re: CSE Array Formula doesn't work

    Actually SUMPRODUCT might work ......

    You have a strange date in B1 so you aren't restricting the date range as you want - change B1 to 1/10/2011

  13. #13
    Registered User
    Join Date
    12-02-2010
    Location
    Huntington, New York, USA
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: CSE Array Formula doesn't work

    RIGHT YOU ARE!!

    DADDYLONGLEGS RULES ...

    Thank you both for your time and effort ... the problem is solved and I will mark the thread as such.

+ 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.6.0 RC 1