how to use sumif to match multiple criteria on same range - criteria

how to use sumif to sum up multiple criteria on same range?
i use the formula =sumif(C3:C7,{"A","B","C"},D3:D7), it was able to sum-up only "A".
Even through =sum(sumif(C3:C7,{"A","B","C"},D3:D7)) does not work as well as shown in this screenshot

Try
=SUMIF(C3:C7;"A";D3:D7)+SUMIF(C3:C7;"B";D3:D7) +SUMIF(C3:C7;"C";D3:D7)
or
=SUMPRODUCT(SUMIF(C3:C7;{"A";"B";"C"};D3:D7))
or
=SUMPRODUCT(D3:D7;(C3:C7="A")+(C3:C7="B")+(C3:C7="C"))

Related

How can I filter by a group of individual dates in Google Sheets?

I have a group of individual dates on one sheet, and I'm looking for a quick way to filter by each individual date (not the range) on another sheet.
Group of individual dates
Values I'm trying to filter
Thank you.
I tried separating the dates by comma and putting them into the 'filter by - exact date' part of the filter tool. It will only recognize one date, not multiple.
I'm guessing what you may want to do. But if you want to filter by formula your range according to the dates match your second range you can do something like this:
=FILTER (Sheet1!A:O,INDEX(IFERROR (MATCH(Sheet1!A:A,Sheet2!A:A,0))))
Change the ranges accordingly. I used sheet 2 as the set of dates you wanted to filter by

Conditional formatting google sheets, match date between two dates- mark that row that is matching

I am looking for a way to match any date in a column of dates with a bunch of start/end periods at columns next to it. If any match, mark my cell.
I have managed to do this for one row, but I would like it to look at a whole column (or set range ex X6-X10) and compare with a bunch of date-periods in two columns.
Any one with any ideas of how I can do that?
This is what I have come up with so far:
And I am using this formula:
=AND($X$6>=$R$6,$X$6<=$T$6)
But, as I said, this only works for one row today. I would like to look through all rows in the columns.
This formula should work:
=COUNTIFS(X$6:X,">="&R6,X$6:X,"<="&T6)

How can I use DateDiff in a seperate Crystal Reports formula?

I have a formula which uses DateDiff to find out the difference between two dates and excludes the weekends.
I'd like to then use that DateDiff in another formula to calculate averages based on and if/then criteria.
When I put average({date diff formula}) I receive an error of "Invalid Argument was encountered"
I can't use the date diff formula in any formula I try to use it in, is there a reason for this?
Example DateDiff formula:
DateDiff('d',*datecolumn*,today)
Then pass that thru into your running total, eg:
Make a grouping in your group expert for the set you wish to summarize with an average, select that group in the Evaluate section and, if desired, in the Reset as well.
Let me know if this isn't quite it for you, good luck!

Sorting Data by Latest Date, selecting top 10 and charting (v. 10.0.1)

This is the data table that I have created
I need to sort the data by 'April2017' in descending order and then select the top 10 projects.
When we select top10 basis April2017, the output should be
Instead what I get is
Here is what I've tried out so far,
Created a calculated field
Calculation1 = iif([Year_Month]=MAKEDATE(2017,4,1),[Claim Count],0)
Sorted Projects based on 'Calculation1'
Drag Project to Filter and select Top10 based on sum([Calculation1])
I am unable to understand how the top10 here is being derived.
Where am I going wrong?
The chart that I am trying to get should be similar to
Please help me with this problem.
You can filter to a selected portion of data in a calculation and use as desired. So create a calculated field called, say April_2017_Foobars, defined as:
if datetrunc('month', [Year_Month]) = #04/01/2017# then [Foobars] end
This field return [Foobars] for the April 2017 rows and null for other rows. Nulls are ignored by aggregate functions, so if you aggregate with SUM() or AVG() etc, the effect is to filter to April 2017 for that field alone.
Then you can use April_2017_Foobars for sorting and defining top filters for your Project field. This is a very general technique that is useful in all kinds of situations.
You can generalize it a bit to use a parameter for the special month rather than hard code it - or use an LOD calc to find the last month in your dataset if you always intend to use the latest month.
P.S. You can use the makedate() function instead of a date literal if you prefer and your data source supports that function. Might avoid any confusion about date literal formats being different in various countries.
create Calculation1 field: iif([Year_Month]="April 2017",[Number],0)
sort Project in descending order on Calculation1 Sum
drag Project to filters, and do Top > By Field > Top: 10 by Calculation1 Sum

Use a Level of Detail Expression in Tablaeu on 1 of 2 forms of a date variable

In Tableau a Level of Detail Expression allows you to create a calculated variable that is affected by none or only some of the view level filters.
I have a view that has 2 filters based on the same column -- a YEAR(Date) filter and a MONTH(Date) filter.
If my Level of Detail Expression is:
{EXCLUDE [Date mdy]: SUM([count.Attrition])}
that won't work because it would remove both date filters. I only want to remove the MONTH date filter.
However, this
{EXCLUDE [MONTH(Date mdy)]: SUM([count.Attrition])}
is an invalid expression and this:
{EXCLUDE MONTH([Date mdy]): SUM([count.Attrition])}
is allegedly valid but doesn't actually work.
Hack-R, how about using FIXED, I think that should help solve this:
{FIXED [Year] : SUM([count.Attrition]) }
Using FIXED is basically forcing Tableau to calculate aggregate measure at specific level - in this case on Year
[Year] is just a simple calculated field which returns Year value.
YEAR([Date mdy])
Creating a dedicated calculated field is probably not really necessary in Tableau 10, but it's just my personal preference to keep things organized.
You might be wonder why EXCLUDE didn't work - I think the main use-case is different with INCLUDE/EXCLUDE and probably best explained in this (a bit lengthly) article.
Hope this helps.