Results 1 to 7 of 7

Thread: Excel Sumproduct with multiple criteria

  1. #1
    Master Browser PeteSmith's Avatar
    Join Date
    Aug 2004
    Location
    LV-426
    Posts
    661
    Thanks
    44
    Thanked
    45 times in 42 posts
    • PeteSmith's system
      • Motherboard:
      • ABIT IP35 Pro
      • CPU:
      • Q6600 G0
      • Memory:
      • 4x1GB 8500 Crucial Ballistix
      • Storage:
      • System: Crucial 128GB M4 SSD Storage: 2x500GB WD5000AAKS
      • Graphics card(s):
      • GTX 650
      • PSU:
      • Corsair HX 620
      • Case:
      • Antec P182
      • Operating System:
      • Windows 10
      • Monitor(s):
      • Dell 2407WFP-HC

    Excel Sumproduct with multiple criteria

    Hi, Can someone help me please with the following formula. The current sumproduct formula works fine but what i really need is to add another criteria (<01/02/2007) so that it checks the whole month, not just the 1st day.

    Code:
    = SUMPRODUCT(SUMIF(INDIRECT("'"&D2:D100&"'!F12:F47"),">=01/01/2007",INDIRECT("'"&D2:D100&"'!H12:H47")))
    I have tried various different ways but none that work. Any suggestions?
    Main PC : Abit IP35-Pro | Q6600 G0 @ 3GHz | 4x1GB Crucial Ballistix 8500 | MSI N460 GTX HAWX | 1 x Crucial M4 128GB SSD | Antec 182 | Corsair HX620 | Dell 2407WFP-HC | Windows 10 x64
    Server : HP MicroServer N40L | 16 GB RAM | 4 X 1 GB Samsung Spinpoint F1 | ESXi 6.0 NAS : Synology DS-408 - 4 x 3GB WD RED HTPC : Acer Revo RL70 | LibreElec

  2. #2
    YUKIKAZE arthurleung's Avatar
    Join Date
    Feb 2005
    Location
    Aberdeen
    Posts
    3,280
    Thanks
    8
    Thanked
    88 times in 83 posts
    • arthurleung's system
      • Motherboard:
      • Asus P5E (Rampage Formula 0902)
      • CPU:
      • Intel Core2Quad Q9550 3.6Ghz 1.2V
      • Memory:
      • A-Data DDR2-800 2x2GB CL4
      • Storage:
      • 4x1TB WD1000FYPS @ RAID5 3Ware 9500S-8 / 3x 1TB Samsung Ecogreen F2
      • Graphics card(s):
      • GeCube HD4870 512MB
      • PSU:
      • Corsair VX450
      • Case:
      • Antec P180
      • Operating System:
      • Windows Server 2008 Standard
      • Monitor(s):
      • Dell Ultrasharp 2709W + 2001FP
      • Internet:
      • Be*Unlimited 20Mbps

    Re: Excel Sumproduct with multiple criteria

    a little bit of google search gives me:

    Code:
    AND('criteria A','criteria B')
    that you can use.

    Effectively replacing:
    Code:
    ">=01/01/2007"
    With:
    Code:
    AND(">=01/01/2007","<01/02/2007")

  3. #3
    Master Browser PeteSmith's Avatar
    Join Date
    Aug 2004
    Location
    LV-426
    Posts
    661
    Thanks
    44
    Thanked
    45 times in 42 posts
    • PeteSmith's system
      • Motherboard:
      • ABIT IP35 Pro
      • CPU:
      • Q6600 G0
      • Memory:
      • 4x1GB 8500 Crucial Ballistix
      • Storage:
      • System: Crucial 128GB M4 SSD Storage: 2x500GB WD5000AAKS
      • Graphics card(s):
      • GTX 650
      • PSU:
      • Corsair HX 620
      • Case:
      • Antec P182
      • Operating System:
      • Windows 10
      • Monitor(s):
      • Dell 2407WFP-HC

    Re: Excel Sumproduct with multiple criteria

    Hi, thanks for the reply, unfortunately that did not work. The problem i have is because of the Date() function in excel, even though i have formatted the cell to MMM YY, so it picks out the whole month and not just the 1st day, it still defaults to the 1st of the month 01/01/2007. Hence why i need it to check multiple criteria so that checks the whole month.

    Even though the following did not return any errors, it does not work. Perhaps i have written this wrong, i'm not sure.

    Code:
    =SUMPRODUCT(SUMIF(INDIRECT("'"&D2:D100&"'!F12:F47"),AND(">=01/01/2007, 01/02/2007"),INDIRECT("'"&D2:D100&"'!H12:H47")))
    Main PC : Abit IP35-Pro | Q6600 G0 @ 3GHz | 4x1GB Crucial Ballistix 8500 | MSI N460 GTX HAWX | 1 x Crucial M4 128GB SSD | Antec 182 | Corsair HX620 | Dell 2407WFP-HC | Windows 10 x64
    Server : HP MicroServer N40L | 16 GB RAM | 4 X 1 GB Samsung Spinpoint F1 | ESXi 6.0 NAS : Synology DS-408 - 4 x 3GB WD RED HTPC : Acer Revo RL70 | LibreElec

  4. #4
    Welcome to stampytown! Salazaar's Avatar
    Join Date
    Dec 2004
    Location
    Oxford-ish
    Posts
    4,459
    Thanks
    505
    Thanked
    353 times in 254 posts
    • Salazaar's system
      • Motherboard:
      • Asrock B450m Steel Legend
      • CPU:
      • Ryzen 5 3600
      • Graphics card(s):
      • 5700 XT

    Re: Excel Sumproduct with multiple criteria

    Just formatting the cell to MMM YY wont actually change the value of the cell. Have you tried using the =MONTH() funtion to return just the value of the month?

    Re-reading the original, I'm not sure this will solve your problem actually...
    ____
    (='.'=)
    (")_(")

  5. #5
    Mostly Me Lucio's Avatar
    Join Date
    Mar 2007
    Location
    Tring
    Posts
    5,163
    Thanks
    443
    Thanked
    448 times in 351 posts
    • Lucio's system
      • Motherboard:
      • Gigabyte GA-970A-UD3P
      • CPU:
      • AMD FX-6350 with Cooler Master Seldon 240
      • Memory:
      • 2x4GB Corsair DDR3 Vengeance
      • Storage:
      • 128GB Toshiba, 2.5" SSD, 1TB WD Blue WD10EZEX, 500GB Seagate Baracuda 7200.11
      • Graphics card(s):
      • Sapphire R9 270X 4GB
      • PSU:
      • 600W Silverstone Strider SST-ST60F
      • Case:
      • Cooler Master HAF XB
      • Operating System:
      • Windows 8.1 64Bit
      • Monitor(s):
      • Samsung 2032BW, 1680 x 1050
      • Internet:
      • 16Mb Plusnet

    Re: Excel Sumproduct with multiple criteria

    Ok, I'm puzzled, why if you are using SUMPRODUCT, do you have SUMIF contained within the same formula?

    SUMPRODUCT will multiply two arrays of the same size, line by line, SUMIF, will add the totals together IF they meet a certain criteria and AFAIK you can't combine them.


    What I think you're actually looking for is an array formula, they're a pain in the arse to write but once done, should do what you really intend, which is add data from a randomly sorted list based on criteria

    The basic idea is as follows SUM(IF(AND(column1=>01/01/2007,column1<=31/01/07),range1,0) and then press ctrl+shift+enter to input it. If done correctly, the formula becomes encased in { }. The end effect is that line by line, Excel evaluates the formula in order, and if the two IF's evaluate to TRUE, gives you another number to be included in the SUM, if it evaluates to FALSE, then it just returns a 0 for that line. If you want to use SUMPRODUCT, I think what you'd have to do is declare two seperate ARRAYS and put the SUMPRODUCT around that (or more simply, put a column in with the product of the two columns line by line and change range1 to target that)

    (\___/) (\___/) (\___/) (\___/) (\___/) (\___/) (\___/)
    (='.'=) (='.'=) (='.'=) (='.'=) (='.'=) (='.'=) (='.'=)
    (")_(") (")_(") (")_(") (")_(") (")_(") (")_(") (")_(")


    This is bunny and friends. He is fed up waiting for everyone to help him out, and decided to help himself instead!

  6. #6
    Mostly Me Lucio's Avatar
    Join Date
    Mar 2007
    Location
    Tring
    Posts
    5,163
    Thanks
    443
    Thanked
    448 times in 351 posts
    • Lucio's system
      • Motherboard:
      • Gigabyte GA-970A-UD3P
      • CPU:
      • AMD FX-6350 with Cooler Master Seldon 240
      • Memory:
      • 2x4GB Corsair DDR3 Vengeance
      • Storage:
      • 128GB Toshiba, 2.5" SSD, 1TB WD Blue WD10EZEX, 500GB Seagate Baracuda 7200.11
      • Graphics card(s):
      • Sapphire R9 270X 4GB
      • PSU:
      • 600W Silverstone Strider SST-ST60F
      • Case:
      • Cooler Master HAF XB
      • Operating System:
      • Windows 8.1 64Bit
      • Monitor(s):
      • Samsung 2032BW, 1680 x 1050
      • Internet:
      • 16Mb Plusnet

    Re: Excel Sumproduct with multiple criteria

    Just because I'm nice, here's a formula that'll work for definiate, remember to press ctrl+shift+enter to make it an array formula

    SUMPRODUCT(IF(date_range>=DATE(2007,1,1),IF(date_range<=DATE(2007,1,31),range1,0),0),IF(date_column> =DATE(2007,1,1),IF(date_column<=DATE(2007,1,31),range2,0),0))

    Replace range 1 and range 2 with the correct target ranges for your SUMPRODUCT and date_range is the column with the date in. It's important to make all ranges the same length and NOT to only select a column

    (\___/) (\___/) (\___/) (\___/) (\___/) (\___/) (\___/)
    (='.'=) (='.'=) (='.'=) (='.'=) (='.'=) (='.'=) (='.'=)
    (")_(") (")_(") (")_(") (")_(") (")_(") (")_(") (")_(")


    This is bunny and friends. He is fed up waiting for everyone to help him out, and decided to help himself instead!

  7. #7
    Registered User
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: Excel Sumproduct with multiple criteria

    Hi - I'm trying to use this date-range validation for a SUMIF array formula:

    =SUM(IF(AND(Detailed!F3etailed!F1002>=B24,Detailed!F3etailed!F1002<=C24),Detailed!Z3etailed!Z1002,0)) with Ctrl+Shift+Enter

    ...where Detailed!F3etailed!F1002 is a single date in DD-MMM-YY format
    ...where Detailed!Z3etailed!Z1002 is what need to be summed (numeric values)
    ...where B24 is the start date (DD-MMM-YY)
    ...where C24 is the end end (DD-MMM-YY)

    The problem is that it doesn't sum. I don't get an error though, it just shows 0.00.
    Any ideas? Thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel help (Conditional Formatting)
    By Workaholic in forum Software
    Replies: 3
    Last Post: 04-02-2008, 01:31 AM
  2. .NET Reading Multiple Excel Files
    By Shadow_101 in forum Software
    Replies: 5
    Last Post: 23-11-2007, 03:22 PM
  3. How to import multiple Excel files to Access?
    By zhenboy in forum Software
    Replies: 1
    Last Post: 11-10-2007, 03:08 PM
  4. Excel + Database + Automated
    By Kezzer in forum Software
    Replies: 4
    Last Post: 29-03-2007, 04:54 PM
  5. Replies: 6
    Last Post: 12-08-2005, 08:50 AM

Posting Permissions

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