I would like to include the count of blank cells in a column using countifs
=IF(COUNTIFS(Table5[CH Code & Room],$U67,Table5[Residency from],"<="&AA$6,Table5[Residency to],">="&AA$6,Table5[Residency to],"")>=1,1,0)
This formula works will all apart from counting blanks
All the -IFS functions use AND logic so, if you want to use OR logic then you would have to sum multiple -IFS functions - a more concise approach is to use SUMPRODUCT(), e.g.
=IF(SUMPRODUCT((Table5[CH Code & Room]=$U67)*(Table5[Residency from]<=AA$6)*((Table5[Residency to]>=AA$6)+(Table5[Residency to]=""))),1,0)
Related
I'm trying to count the team members involved in the project using Excel IF + COUNTIF formulas. So far I've been doing pretty well using this formula that checks if this role is in the list on the left, compares it to the right table, and how many people are assigned to this role:
=IF(H10<>"",COUNTIFS($P$9:$P$108,H10,$R$9:$R$108,"Onboard"),"")
But I would like to adjust it so that after doing so it would also add the specific manual number from the Q row. Again, only for the specific role that needs to be checked on the left. Here's what I came up with so far, but it only counts the times it matched:
=IF(H9<>"",COUNTIFS($P$9:$P$108,H9,$R$9:$R$108,"Onboard"),"")+IF(H9<>"",COUNTIFS($Q$9:$Q$108,">0",$P$9:$P$108,H9),"")
How can I modify this formula, so the exact number from the Q9 that matches the role on the left is added to the 'onboard' cell?
Instead of using COUNTIFS on the second part of the formula, use SUMIFS
=IF(H9<>"",COUNTIFS($P$9:$P$108,H9,$R$9:$R$108,"Onboard")+SUMIFS(Q9:$Q$108,$P$9:$P$108,H9,$R$9:$R$108,"Onboard"),"")
SUMIFS will take the exact numbers from the cells whereas COUNTIFS will count the number of occurrences based on the conditions
Also you can combine the COUNTIFS + SUMIFS inside the True statement of your IF function instead of checking the condition again
I am having significant issues trying to resolve my problem. Essentially I need an excel formula that replicates a SUMIFS function, as it appears that sumifs doesn't work in my scenario. Effectively I need to SUM across a horizontal axis, based on the date & header parameter. I have tried summing index-matches, sumifs, aggregates, summing sumif, summing vlookups & hlookups, and I either get errant values or I get the first value (for example, store A would return 0 for 7/8 & Store G would return -3,291)
=SUMIF($1:$1,B22,INDEX($C$2:$AQ$1977,1,MATCH($A982,$A$2:$A$9977,0)))
=SUMIFS(B2:N2,1:1,B22,A:A,A23)
=SUM(SUMIF($B$1:$N$1,$B23,INDEX($B$2:$N$12,1,MATCH($A23,$A$2:$A$12,0))),SUMIF($B$1:$N$1,$B23,INDEX($B$2:$N$12,2,MATCH($A23,$A$2:$A$12,0))),SUMIF($B$1:$N$1,$B23,INDEX($B$2:$N$23,3,MATCH($A23,$A$2:$A12,0)))).
I'm sure the sumrange is what is killing me, but I would ideally like the code to be dynamic enough to locate and sum the cells via references, in case the input data changes at some point. I am working with thousands of rows so the sum range is B2:AQ10000.
The formula is on a different sheet than this but i input it as an example.
What am I missing? Is there a way to do this with Excel?
Use:
=SIMIFS(INDEX($B$2:$N$12,MATCH($A23,$A$2:$A$12,0),0),$B$1:$N$1,B$22)
I'm trying to count if the following range is "Y" or "S" and contains numbers. I'm trying to exclude cells beginning with "_PVxxxxx_".
I cant use
COUNTIFS($A:$A,">0",$B:$B,"Y") + COUNTIFS($A:$A,">0",$B:$B,"S")
because the formula considers "_PVxxxxx_" to be more than 0 and includes them in the calculation.
Can anybody help? Thanks alot!
The function SUMPRODUCT is quite versatile, typically more flexible for testing than COUNTIFS and SUMIFS.
It should do the trick
(see e.g. https://stackoverflow.com/a/27935006/2707864 or https://stackoverflow.com/a/30854706/2707864)
with
=SUMPRODUCT(($A:$A>0)*($B:$B="Y")*(ISNUMBER($A:$A))+...
This works, but I am not sure that you need the part ($A:$A>0)* according to the sample you posted (it doesn't hurt anyway).
PS: If you insist on using COUNTIFS you could use a helper column that uses ISNUMBER and gives, e.g., a suitable numeric result (>0 for numeric data, <0 otherwise). Then you would refer to that column within COUNTIFS.
I need to sum the values of several columns, if other cells in the same row match a predefined criteria. The working formula for only 3 columns is the following:
=SUM(SUMIFS(‘Sheet1'!W:W; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4");SUMIFS(‘Sheet1'!X:X; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4");SUMIFS(‘Sheet1'!Y:Y; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4"))
I will need to use the formula for several cells (and sum more than 10 columns per time) and I will need to change the columns manually, so I need the same formula in the following way:
=SUMIFS(‘Sheet1'!W:Y; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4")
,but currently this formula leads to a "#VALUE!" error. The reason for that is (I assume) the use of multiple columns "W:Y"
Can you suggest a workaround?
I would suggest to use SUMPRODUCT rather than SUMIFS. You can build something like that :
=SUMPRODUCT((B1:B1048575="Sales")*(C1:C1048575>=4)*(W1:Y1048575))
The downside of SUMPRODUCT is that you can't use a whole column (for example you cannot write SUMPRODUCT((B:B="Sales"...)), this would generate an error).
Hope this helps.
I suggest you add a column with the sum('sheet1'!W:Y) and then use sumifs on this columns. It is a two step way but it will give the result you expect
Here's what I have :)
=SUM(SUMIFS('WTD Raw'!R:R,'WTD Raw'!E:E,"Kindle-Customer Care",'WTD
Raw'!J:J,"Week27",'WTD Raw'!H:H,'PassRate | July'!G8) + SUMIFS('WTD
Raw'!R:R,'WTD
Raw'!E:E,"Kindle-Technical Support",'WTD Raw'!J:J,"Week27",'WTD
Raw'!H:H,'PassRate | July'!G8))
Instead of using ";" use the Mathematical Operators for it to work.
I would like to create a succinct Excel formula that SUMS a column based on a set of AND conditions, plus a set of OR conditions.
My Excel table contains the following data and I used defined names for the columns.
Quote_Value (Worksheet!$A:$A) holds an accounting value.
Days_To_Close (Worksheet!$B:$B) contains a formula that results in a number.
Salesman (Worksheet!$C:$C) contains text and is a name.
Quote_Month (Worksheet!$D:$D) contains a formula (=TEXT(Worksheet!$E:$E,"mmm-yy"))to convert a date/time number from another column into a text based month reference.
I want to SUM Quote_Value if Salesman equals JBloggs and Days_To_Close is equal to or less than 90 and Quote_Month is equal to one of the following (Oct-13, Nov-13, or Dec-13).
At the moment, I've got this to work but it includes a lot of repetition, which I don't think I need.
=SUM(SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Oct-13")+SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Nov-13")+SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Dec-13"))
What I'd like to do is something more like the following but I can't work out the correct syntax:
=SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,OR(Quote_Month="Oct-13",Quote_Month="Nov-13",Quote_Month="Dec-13"))
That formula doesn't error, it just returns a 0 value. Yet if I manually examine the data, that's not correct. I even tried using TRIM(Quote_Month) to make sure that spaces hadn't crept into the data but the fact that my extended SUM formula works indicates that the data is OK and that it's a syntax issue. Can anybody steer me in the right direction?
You can use SUMIFS like this
=SUM(SUMIFS(Quote_Value,Salesman,"JBloggs",Days_To_Close,"<=90",Quote_Month,{"Oct-13","Nov-13","Dec-13"}))
The SUMIFS function will return an "array" of 3 values (one total each for "Oct-13", "Nov-13" and "Dec-13"), so you need SUM to sum that array and give you the final result.
Be careful with this syntax, you can only have at most two criteria within the formula with "OR" conditions...and if there are two then in one you must separate the criteria with commas, in the other with semi-colons.
If you need more you might use SUMPRODUCT with MATCH, e.g. in your case
=SUMPRODUCT(Quote_Value,(Salesman="JBloggs")*(Days_To_Close<=90)*ISNUMBER(MATCH(Quote_Month,{"Oct-13","Nov-13","Dec-13"},0)))
In that version you can add any number of "OR" criteria using ISNUMBER/MATCH
You can use DSUM, which will be more flexible. Like if you want to change the name of Salesman or the Quote Month, you need not change the formula, but only some criteria cells. Please see the link below for details...Even the criteria can be formula to copied from other sheets
http://office.microsoft.com/en-us/excel-help/dsum-function-HP010342460.aspx?CTT=1
You might consider referencing the actual date/time in the source column for Quote_Month, then you could transform your OR into a couple of ANDs, something like (assuing the date's in something I've chosen to call Quote_Date)
=SUMIFS(Quote_Value,"<=90",Quote_Date,">="&DATE(2013,11,1),Quote_Date,"<="&DATE(2013,12,31),Salesman,"=JBloggs",Days_To_Close)
(I moved the interesting conditions to the front).
This approach works here because that "OR" condition is actually specifying a date range - it might not work in other cases.
Quote_Month (Worksheet!$D:$D) contains a formula (=TEXT(Worksheet!$E:$E,"mmm-yy"))to convert a date/time number from another column into a text based month reference.
You can use OR by adding + in Sumproduct. See this
=SUMPRODUCT((Quote_Value)*(Salesman="JBloggs")*(Days_To_Close<=90)*((Quote_Month="Cond1")+(Quote_Month="Cond2")+(Quote_Month="Cond3")))
ScreenShot
Speed
SUMPRODUCT is faster than SUM arrays, i.e. having {} arrays in the SUM function. SUMIFS is 30% faster than SUMPRODUCT.
{SUM(SUMIFS({}))} vs SUMPRODUCT(SUMIFS({})) both works fine, but SUMPRODUCT feels a bit easier to write without the CTRL-SHIFT-ENTER to create the {}.
Preference
I personally prefer writing SUMPRODUCT(--(ISNUMBER(MATCH(...)))) over SUMPRODUCT(SUMIFS({})) for multiple criteria.
However, if you have a drop-down menu where you want to select specific characteristics or all, SUMPRODUCT(SUMIFS()), is the only way to go. (as for selecting "all", the value should enter in "<>" + "Whatever word you want as long as it's not part of the specific characteristics".
In order to get the formula to work place the cursor inside the formula and press ctr+shift+enter and then it will work!
With the following, it is easy to link the Cell address...
=SUM(SUMIFS(FAGLL03!$I$4:$I$1048576,FAGLL03!$A$4:$A$1048576,">="&INDIRECT("A"&ROW()),FAGLL03!$A$4:$A$1048576,"<="&INDIRECT("B"&ROW()),FAGLL03!$Q$4:$Q$1048576,E$2))
Can use address / substitute / Column functions as required to use Cell addresses in full DYNAMIC.