Sumifs using multiple criteria

willwall

New Member
Joined
Sep 22, 2016
Messages
44
Office Version
  1. 365
Platform
  1. Windows
Hello
I am using sumifs to retrieve data from a table. On column "F" in the table i have a list of projects with transactions. On column "I" on the table I have the revenue generated from each project. What i want to do is use sumifs to calculate "all" revenues for all projects combined or in some cases calculate revenue for individual projects by typing in the project number in the criteria field.
Sum range = table
Criteria_range 1 = Column A
Criteria 22000 (project number) I would like some function here that can pick out "all" the projects and not just one.
If i could write e.g "All" or "22000" in the actual criteria cell it would be great. I tried a data validation drop down list which has no "All" function
 

Attachments

  • fgdf.GIF
    fgdf.GIF
    5.6 KB · Views: 4
  • Projekt rev.GIF
    Projekt rev.GIF
    23.9 KB · Views: 5

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi, you could try something like this, for example.

Book1
ABCDE
1Criteria CellFormulaProjectRevenue
2All650220005
32200015
422010485
52202045
6220104
72200077
8220108
9220207
10220004
Sheet1
Cell Formulas
RangeFormula
B2B2=SUMIFS(E:E,D:D,IF(A2="All","<>",A2))
 
Upvote 0
Another way would be

=IF(A2="All",SUM(E:E),SUMIF(D:D,A2,E:E))

Note that I've used SUMIF instead of SUMIFS as this method wouldn't work with more than 1 criteria range.
 
Upvote 0
Hello Jasonb75
Both work great but I discovered that i need to take it one step further.
Above we wrote a formula for the revenue for "All" projects. I need to add in an account number to this so that "All" revenue for ledger number e.g 3000 gets summarised. Also there is a column in the table that shows completed projects "Yes or "No" which is also parts of the criteria. There are 2 cells marked in red where I usually type in the criteria. I attached a file to show what i mean. Maybe i have to use a pivottable for this, as there are a few filters involved. Really appreciate your help :)
 

Attachments

  • Capture.GIF
    Capture.GIF
    19.7 KB · Views: 5
Upvote 0
Hi, not sure if I'm missing something but can't you just add the additional criteria into the SUMIFS() formula?
 
Upvote 0
If you want the 'All' option for both red cells then you would need to use FormR's method, for example

=SUMIFS(D:D,C:C,IF(B3="All","<>",B3),E:E,IF(B2="All","<>",B2))
 
Upvote 0
Yep this formula works and i added the extra sumif for the account number
=SUMIFS(D6:D14;C6:C14;IF(B3="All";"<>";B3);E6:E14;IF(B2="All";"<>";B2);F6:F14;C18)
Thanks guys for your help, this forum fanstastic. :)
 

Attachments

  • Capture1.JPG
    Capture1.JPG
    57.6 KB · Views: 4
Upvote 0

Forum statistics

Threads
1,214,392
Messages
6,119,254
Members
448,879
Latest member
oksanana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top