countifs same criteria in diffrent criteria ranges - excel

Need to countifs values between two dates and need to lookup same criteria in different criteria ranges (columns I,J,K) values.I used below formula in N6.Answer should 3.between given dates how many rows are common for given line no in(M4) between given start and end date.Please advise.
=COUNTIFS(A2:A7,">="&N2,A2:A7,"<="&N3,H2:H7,"PASS",I2:I7,M4,J2:J7,M4,K2:K7,M4)

As long as 33A occurs just once in columns I-K you could use:
=SUMPRODUCT((A2:A7>=N2)*(A2:A7<=N3)*(H2:H7="PASS")*(I2:K7=M4))

Related

how to sum values by unique condition on MS Excel?

I have two columns one for date and one for value. the date columns have different dates with duplicates date and the values are different with duplicates values. Is there any way to sum just one value of duplicate dates with just one value of other duplicate dates?
I tried sumif, sumifs, countif, countifs functions...
In Office 365:
=SUM(TAKE(UNIQUE(C6:D13),,1))
Which takes the unique rows in the range and takes the first column in the sum.
In older versions:
=SUMPRODUCT((C6:C13/(COUNTIF(D6:D13,D6:D13))))
Where it sums all values but divided by the count of the dates occurring in the range. So if it occurs 3 times it sums 3*500/3 =500
For older Excel this may be calculating faster than the above:
=SUMPRODUCT(C6:C14*(FREQUENCY(D6:D13,D6:D13)>0))
Note that the first range is expanded one row, since frequency results in an array followed by a 0

Excel Sum Formula With Multiple Criteria

So I'm having a problem with summing some data in a range with multiple criteria. Take the data below as an example:
I would like to sum all numbers where: Name = Bob AND the top row is equal to 02/01/20.
The current formula i have is with a SUMPRODUCT, but i'm not sure if it's the solution
=SUMPRODUCT((Names="Bob")*(Dates="02/01/2020")*Values)
Where Names is a named range for my names, Dates is a named range for my dates and Values is a named range for all my values in the table. However, the formula keeps resulting in "#VALUE!".
Any ideas anyone?
You need to turn your date string into a date value. So try:
=SUMPRODUCT((Names= "Bob")*(Dates=--"02/01/2020")*Values)

Countifs does not work when a range with multiple column is selected

I need a count if function that counts me the cells that meet a certain criteria. This should be done with countifs. The formula is the following:
=COUNTIFS(Orders!D:D;"*Ecolab*";Orders!B:B;">=01/01/2019";Orders!U:U;">=36";Orders!K:Q;">=1")This formula returns me an value type error.
This formula works well until I introduce the last condition orders!K:Q;">=1"
I would like a formula that counts if the word Ecolab is present in the cell; if the date is after or equal 01/01/2019; if the column U has more or equal than the number 36 and if there is at least a "1" in the cells in the row from column K to column Q. I could do this by easily replicating the countifs several times, (i.e =COUNTIFS(Orders!D:D;"*Ecolab*";Orders!B:B;">=01/01/2019";Orders!U:U;">=36";Orders!K:K;">=1")+COUNTIFS(Orders!D:D;"*Ecolab*";Orders!B:B;">=01/01/2019";Orders!U:U;">=36";Orders!L:L;">=1")+...........+COUNTIFS(Orders!D:D;"*Ecolab*";Orders!B:B;">=01/01/2019";Orders!U:U;">=36";Orders!Q:Q;">=1")
But I would rather not include such a long formula as it would create confusion for the ultimate user of the excel sheet
Per my comment above, you could use SUMPRODUCT (avoid using whole columns for that) or an array with OFFSET like this:
=SUM(COUNTIFS(Orders!D:D;"*Ecolab*";Orders!B:B;">=01/01/2019";Orders!U:U;">=36";OFFSET(Orders!J:J;0;{1;2;3;4;5;6;7});">=1"))
If the count for K:Q should be 1 when there may be more than one cell greater or equal to 1 in a single row then you need to apply OR criteria in a SUMPRODUCT.
SUMPRODUCT formulas should not use full column references; there is too much wasted calculation. The following is for rows 2:99; adjust for your own use.
=SUMPRODUCT(--ISNUMBER(SEARCH("ecolab", Orders!D2:D99)),
--(Orders!B2:B99>=DATE(2019, 1, 1)),
--(Orders!U2:U99>=36),
SIGN((Orders!K2:K99>=1)+(Orders!L2:L99>=1)+(Orders!M2:M99>=1)+(Orders!N2:N99>=1)+(Orders!O2:O99>=1)+(Orders!P2:P99>=1)+(Orders!Q2:Q99>=1)))

Excel - COUNTIF and SUMIF across multiple rows

I have a sheet with multiple columns of "Yes" / "No". I need to count the number of rows that have >5 "Yes". Obviously determining if an individual row should be included is easy using countif, but I can't figure out how to make the row 'eligible to be counted' and then sum the number of rows that meet my criteria.
Assuming your range is A2:Z100 this array formula will count the number of rows with 5 or more "Yes" entries
=SUM((MMULT((A2:Z100="Yes")+0,TRANSPOSE(COLUMN(A2:Z100)^0))>=5)+0)
confirm with CTRL+SHIFT+ENTER
or you can use this version with FREQUENCY
=SUM(IF(FREQUENCY(IF(A2:Z100="Yes",ROW(A2:Z100)),ROW(A2:Z100))>=5,1))
....which also needs "array entry"
or a third approach with COUNTIF - doesn't need array entry
=SUMPRODUCT(0+(COUNTIF(OFFSET(A2:Z100,ROW(A2:A100)-ROW(A2),0,1),"Yes")>=5))

Sumif vs Sumifs in Excel

here is my understanding on sum functions:
Sumifs do not accept multiple columns in sum_range but Sumif do, is that correct?
if it is, could you please suggest an alternative to include multiple columns for sum range. Thanks!
No. SUMIFS only allow a sum of one column, much like SUMIF.
The difference is in the number of criteria ranges.
In a SUMIFS, you would say
=SUMIFS(sum range, criteria range 1, criteria 1, criteria range 2, criteria 2, ...)
If you want to sum multiple columns, you can add multiple SUMIFSes:
=SUMIFS(...) + SUMIFS(...) + SUMIFS(...)

Resources