is it possible to make multiple criteria Sumifs based on range input? - excel

I am trying to get sum of a sales column for different combination of filter columns say, area, region, prods etc. pivot table is good to this but i need only the sum. sometimes i use it in mobile where pivot is not giving me the filter option. please help me to achieve the same through formulae

Related

How to filter information from one column or another in an excel table? range.autofilter?

I have an excel table in which in a column I put countries of which I want to filter by one in particular, but I also want to show those countries in which the number of sales exceeds a certain amount even if it is not the first one by which I filtered.
Filtering with range.autofilter when I filter by countries, then the second filter does not apply.
Help.
Thanks.

Dynamic GETPIVOTDATA formula to SUM with different date ranges per column

I have below an example pivot table with Countries as my columns, and Dates as my rows. The data for this pivot is based on A1:C13. Cells F1:G3 is what the user of this model can adjust. They can change the country and/or the date ranges.
What I am needing is a single formula to output the total of their selection. As my actual data set contains many countries, simply writing an nested IF statement won't suffice. The dataset also needs to be in pivot table - hence the GETPIVOTDATA requirement.
I've gotten about half of the way there using this formula here:
=SUM(GETPIVOTDATA("Sum of Value",$A$15,"Date",ROW(INDIRECT(F2&":"&F3)),"Country",F1:G1))
The problem here is that this formula is not dynamic for the differing date selections per country.
Can anyone assist?
You need a separate GETPIVOTDATA for each country:
=SUM(GETPIVOTDATA("Sum of Value",$A$15,"Date",ROW(INDIRECT(F2&":"&F3)),"Country",F1),GETPIVOTDATA("Sum of Value",$A$15,"Date",ROW(INDIRECT(G2&":"&G3)),"Country",G1))
The answer provided by #basic is the closest one for the original question, i.e. using GETPIVOTDATA to work out the total per given parameters.
If the calculation can be done on the original data table (Range A1:C13), then here is another solution to calculate the total.
=SUMPRODUCT((A2:A13=F1:G1)*(B2:B13>=F2:G2)*(B2:B13<=F3:G3)*(C2:C13))
In order to make the above calculation "dynamic", i.e. the calculation updates as the rows expands in the table, you can put the source data into a Structured Reference Table, give a Name to each column, such as "List_Ctry" for Column A, "List_Date" for Column B, and "List_Value" for Column C, then the range behind each name will update automatically when the source data changes. Using these names, the formula will be something like:
=SUMPRODUCT((List_Ctry=F1:G1)*(List_Date>=F2:G2)*(List_Date<=F3:G3)*List_Value)
You can also give names to the three parameters, being the range of country, range of start date, and range of end date. I will not illustrate further as if you understand the above concepts, you should be able to do this step yourself.
By using Name in the excel workbook, it will enable you to refer to the source data conveniently without the need to lay it out in your final report, so I do not understand what is the limitation here to stop you from calculating from the source data but have to work on the pivot table, as the calculations on pivot table are limited and not that intuitive.
Feel free to let me know if you have any questions :)

How can I use COUNTIF, such that it's reliant on a filter, and a pivot table all in one?

So here's my problem.
I'm using the COUNTIF feature to return a count of all the instances of multiple text queries (all the instances of NHL teams) within a certain range (columns H:W). Easy.
From here I'd like to be able to see this COUNTIF table respond to a filter based on my respondents answer to another question (Column E) which, in this case, is what team they selected as their favourite.
So ideally I'd like to look at how many responses of "x team" via COUNTIF, based on answering a different "x team".
Or in terms of my actual data: see how many times "Anaheim Ducks", "Boston Bruins", all 31 teams etc, are listed in columns H through W (over 2200 rows), after filtering this by respondents who selected "Calgary Flames" as their favourite team.
To me this sounds like using a pivot table? Potentially SUMIF? However, I'm not entirely sure that's what I need nor how to set it up properly.
Here are some screenshots of the data I'm working with:
This is the dataset showing the column I want to sort by, and the columns that I'm using COUNTIF on.
This is the COUNTIF table that I want to respond to my filter of column E in the previous screenshot.

Counting/summarizing values using filtered table in Excel

Is it possible to count/summarize a value in a filtered excel table and subdivide that count based on another parameter (without using macro/VBA)? For example one grocery store can sell multiple items. I want to filter by the store, and then summarize the result based on the item. The image below shows my current formula, it does't work as described (it summarizes the entire items column). I want it to show count for apples as 3 and average price 1.75. If I apply filter to only show Mike's Grocery items, then the count should be 1 and average price 2.25.
Subtotal does not include any criteria for your conditions, and building this with formulas is a bit unwieldy and possibly overkill.
Consider using a Pivot table for your results table and use pivot table filters or slicers instead of filtering the source data.
If you want to use the Subtotal approach, take a look at https://exceljet.net/formula/count-visible-rows-only-with-criteria

Count the numbers of members meeting two criteria?

How do you count the numbers of members in my table?
The table is called Table2. I would like to see the amount of people that meet the criteria of having the membership code of A3 (changing when it moves down a cell) and pay by either Annual Membership 1, or Annual membership 2.
I can recommend three ways of going about this, in descending order of preference.
Use a pivot table to summarise the data into a cross table, if
there is a new type of payment code it automatically be reflected,
you don't need to do complex formulae, only make sure the input
range used for the pivot table includes all the data. You need to
manually refresh the Pivot table.
Use the sumifs() function (you can sum a cell with 1 as value),
research a bit on multiple conditions, there is plenty of info out
there (apparently sumifs() supports up to 29), I can suggest
this one
Sometimes I just use the formula =B1&"-"&C1&"-"D1 (into a fourth E
column) to combine the two or more cells I want to test into a
single text value and then do the countif() or sumif(). It is quick
and dirty but can be very easy to understand and has the benefit
that at each row you have some value you could filter for using the
data filter functionality. You can also use an OR() and IF() to
create the condition at each row that would yield "True" or other
value that is more meaningful (e.g.
If(And(A1="A3",Or(B1="Membership 1",B1="Membership
2")),"VIP","Regular"), then use the countif() at the bottom to count
the VIPs.
You can use also array formulas but I found them
difficult to maintain and I don't have enough real life experience
of using it.
Note: I didn't test the formulae, this is illustrative to give you a start, my advise is you use pivots if you only need a summary reporting.
Good luck!

Resources