=COUNTIFS($C$2:$C$20000,MONTH(8),$K$2:$K$20000,"U")
Where C column is the list of dates, K column is another criteria i want to meet.
Here I'm attempting to count whenever Column C is within the month of August and Column K value is "U", the above formula i used return 0 where I expecting some values.
Not sure what is the problem with my formula.
Month() formula won't work inside COUNTIFS formula, you can use SUMPRODUCT instead:
=SUMPRODUCT((MONTH($C$2:$C$20000)=8)*($K$2:$K$20000="U"))
Or add an extra column to your data, calculate month in it, and use COUNTIFS with the new column.
Related
I have this sheet with data:
the search range (row 3) is filled until column AM and the count range (row 4 and lower) is only filled until column R (more columns will be filled in time)
I need to have a formula to use in my count if formula to find the last filled column.
So in this case the the search range for the countif formula has to be:
=countif(C3:R3;C4:R4)
but when column S is filled, the formula should automatically use column S instead of R. etc.
the formula is used to calculate an average of the scores/percentage for a certain skill (e.g. optellen+aftrekken, tafels, tijd). So just counting the arguments in row 4 or lower is not enough. It also has to count how many times the given skill is found in the applying range (Column C to R, C to S etc).
I have a combinated formula to have the complete first parameter for the countif formula:
="'invoer optie2 (2)'!C$3:"&(ADRES(3;AANTALARG('invoer optie2 (2)'!4:4)+1;2;1))
(the formula is in dutch).
the result is this:
'invoer optie2 (2)'!C$3:R$3
This is the part I need for my countif formula. I keep struggling on how to use this in the countif formula so it uses it a the search range.
How can I convert this "string" to the range in the countif formula?
Do not use ADDRESS and INDIRECT as they are Volatile.
Instead use INDEX:
=COUNTIFS('invoer optie2 (2)'!C$3:INDEX('invoer optie2 (2)'!$3:$3,MATCH(1E+99,'invoer optie2 (2)'!4:4)),"WhatYouWant")
I need to create a formula in excel that returns the sum-product of two columns in a range, based on two conditions.
Considering a table of 4 columns (A;B;C;D), if any row in column A is equal to a given value (example="A") and any row in column B starts with "*", then multiply column C and D and sum these products.
Any suggestions on how to implement the formula?
I thought it could be the following formula but it doesn't work:
=SUMPRODUCT(--(A2:A12="A"); --(left(B2:B12;1)="*"); C2:C12; D2:D12)
You could use an array formula such as :
{=SUM((A2:A12="A")*(LEFT(B2:B12)="*")*C2:C12*D2:D12)}
Remember to validate with ctrl+shift+enter
The formula should sum up the column C based on Column A and B when two column value matches and displays the sum value only in the first cell D2 of Column D as shown in figure "60" & "67".
I am trying with SUMIFS but not getting the Output as required.
=SUMIFS(C2:C6;A2:A6;"A:A";B2:B6)
Try this formula in cell D2:
=IF(SUMPRODUCT(--($A$2:$A2&$B$2:$B2=$A2&$B2))=1,SUMPRODUCT(--($A$2:$A$6&$B$2:$B$6=$A2&$B2),$C$2:$C$6),"")
It should give expected output.
It might also be better/more efficient if you create a helper column (which stores concatenation results, instead of doing the concatenation multiple times in each formula).
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)))
I am trying to get a SUMIFS formula to check a column of dates and sum only the values that correspond to the matching year and month of the criterion date. I would also like this SUMIFS to include a name criterion along with the date. i.e.
Cell A1: =SUMIFS('Sheet1'!O:O, 'Sheet1'!D:D, 'Sheet2'!DATE(B2), 'Sheet1'!E:E, "Name")
sheet1 column O is where the sum values are stored
sheet1 column D is where the date values are stored
sheet2 cell B2 is where the date comparison criterion is stored
sheet1 column E is where the names are stored
"Name" is the name criterion that I want for sum selection
Any insight will be most appreciated!
You can use SUMIFS if you create a start and end date for your dates, i.e. with this version
=SUMIFS('Sheet1'!O:O,'Sheet1'!D:D, ">="&EOMONTH('Sheet2'!B2,-1)+1, 'Sheet1'!D:D, "<"&EOMONTH('Sheet2'!B2,0)+1, 'Sheet1'!E:E, "Name")
EOMONTH is used to get the start and end dates of the relevant month then your SUMIFS sums the correct values based on your other criteria.
If B2 is guaranteed to be the first of the month you can omit the first EOMONTH function
Solution with SUMPRODUCT
I find it simpler to use SUMPRODUCT in situations like this.
For no header row you can simple use:
=SUMPRODUCT((MONTH(Sheet1!D:D)=MONTH(Sheet2!$B$2))*(YEAR(Sheet1!D:D)=YEAR(Sheet2!$B$2))*(Sheet1!E:E="Name"),Sheet1!O:O)
Just replace "Name" with what you want.
If you have a header row (or if the column contains any values that are not valid dates) you need to use an array formula within SUMPRODUCT:
=SUMPRODUCT((IF(ISERROR(MONTH(Sheet1!D:D)),Sheet1!D:D,MONTH(Sheet1!D:D))=MONTH(Sheet2!$B$2))*(IF(ISERROR(YEAR(Sheet1!D:D)),Sheet1!D:D,YEAR(Sheet1!D:D))=YEAR(Sheet2!$B$2))*(Sheet1!E:E="Name"),Sheet1!O:O)
(Array formulas are entered using ctrl + shft + enter)