=SUMIFS($E$10:$E$21,$D$10:$D$21,">="&B1,"<"&B2,"'=0")
"There's a problem with this formula.
Trying to type a formula?"
I don't believe the first criteria are wrong, is the 'equals 0' the issue?
Sumifs() needs pairs of range and condition text for each condition.
Also, the conditions are combined with an AND logic.
=SUMIFS($E$10:$E$21,$D$10:$D$21,">="&B1,$D$10:$D$21,"<"&B2,$D$10:$D$21,0)
If you want OR logic, use three separate SUMIF and add them all up.
Related
I am trying to create a SumIf formula that adds multiple columns together based on one criteria.
=sumif(F$8:F$58,F73,L$8:L$58+I$8:I$58)
This is giving me an error and will not add the two columns together.
You'd need
=sumif(F$8:F$58,F73,L$8:L$58) + sumif(F$8:F$58,F73,I$8:I$58)
I highly recommend you make it a practice to use SUMIFS instead of SUMIF even if you only have one criteria. The order makes more sense (what you're summing first), and it scales easier. Say you want to start adding more criteria, now you'll have to readjust the order of the inputs, whereas with Sumifs you simply just add to the criteria.
=sumifs(L$8:L$58,F$8:F$58,F73) + sumifs(I$8:I$58,F$8:F$58,F73)
In case of summing multiple ranges, you can also try SUMPRODUCT
=SUMPRODUCT((F$8:F$58=F73)*((L$8:L$58)+(I$8:I$58)))
The logic is similar to SUMIFS, (F$8:F$58=F73) sets the criteria while ((L$8:L$58)+(I$8:I$58)) defines the range to be summed.
Let me know if you have any questions. Cheers :)
I want to count all the cells in the column where the date is either after 30th April[&DATE(2018,4,30)] or it is blank[""].
=Countifs($N$2:$N$24388,{">"&DATE(2018,4,30),""})
Going by the syntax, I feel I am doing it right since it's not throwing any error either but it's not giving the correct result.
Later I find out that it's rendering only up till the first condition i.e. the above formula is rendering like this:
=Countifs($N$2:$N$24388,{">"&DATE(2018,4,30)})
It's not accounting for the condition meant for blank("") cells. So the result is incorrect or lesser than what it's supposed to be.
Later I changed the order of condition i.e. to this
=Countifs($N$2:$N$24388,{"",">"&DATE(2018,4,30)})
Now, it is acknowledging the only ("") condition and ignoring the latter one. So, it's giving the same result as what the below formula would give.
=Countifs($N$2:$N$24388,{">"&DATE(2018,4,30)})
Eventually, I tried the following and it worked but it's a lengthy formula and defeats the purpose of having Countifs
=sum(COUNTIFS(N2:N24388,{""})+COUNTIFS($N$2:$N$24388,{">"&DATE(2018,4,30)}))
As I stated, I expect to get the count of all the cells which are either blank OR satisfy a given condition.
Just add two separate COUNTIFs together:
=COUNTIF($N$2:$N$24388,">"&DATE(2018,4,30))+COUNTIF($N$2:$N$24388,"")
This doesn't defeat the purpose of COUNTIFS as you suggest, since COUNTIFS counts values which satisfy all the criteria you specify, whereas you're interested in values which satisfy at least one criterion.
you can use COUNTBLANK:
=COUNTIF($N$2:$N$24388, ">"&DATE(2018, 4, 30))+
COUNTBLANK($N$2:$N$24388)
Your COUNTIFS returns an array of results, so just sum them:
=SUM(Countifs($N$2:$N$24388,{">"&DATE(2018,4,30),""}))
I've been reading a bunch of answers around nesting if/then statements in Excel but I can't figure out how to fix a "formula parse error" in mine. From what I can tell and in my code editor the formula is correct. Any ideas what I'm missing here?
I have a row of cells that auto-generate a number 1-35 based on other values. I want the cell with the formula to pull data from another row based on what's the in row of numbers 1-35. It works when I test one at a time; it's the nesting that is causing the errors. Thanks!
=IF(E$167=1,C56,IF(E$167=2,D56,IF(E$167=3,E56,IF(E$167=4,F56,IF(E$167=5,G56,IF(E$167=6,H56,IF(E$167=7,I56,IF(E$167=8,J56,IF(E$167=9,K56,IF(E$167=10,L56,IF(E$167=11,M56,IF(E$167=12,N56,IF(E$167=13,O56,IF(E$167=14,P56,IF(E$167=15,Q56,IF(E$167=16,R56,IF(E$167=17,S56,IF(E$167=18,T56,IF(E$167=19,U56,IF(E$167=20,V56,IF(E$167=21,W56,IF(E$167=22,X56,IF(E$167=23,Y56,IF(E$167=24,Z56,IF(E$167=25,AA56,IF(E$167=26,AB56,IF(E$167=27,AC56,IF(E$167=28,AD56,IF(E$167=29,AE56,IF(E$167=30,AF56,IF(E$167=31,AG56,IF(E$167=32,AH56,IF(E$167=33,AI56,IF(E$167=34,AJ56,IF(E$167=35,AK56,””)))))))))))))))))))))))))))))))))))
You might have run into a function nesting limit. Try the choose function to work around it.
How about using
=IF(AND(E167>0,E167<36),OFFSET(B56,0,E167),"")
Note : OFFSET is a volatile function, see this for details.
A simple vlookup or hlookup function can do exactly what you need without righting long nested if statement.
for example you can use:
=vlookup(E$167,$A1:$B35,2,false) where $A1:$B35 is the table array containing column A (1-35) and column B its corresponding value.
In Below Code, If I use OR Condition it will work, but I don't know how to use OR condition.
=IF(AND(K2="Quality Healthcare"),VLOOKUP(L2,Dropdown!E80:F84,2,0)),IF(AND(K2="Sky Lakes Medical Center"),VLOOKUP(L2,Dropdown!E80:F84,2,0))
Please help on this, Thanks.
The AND() function in your formula contains only one element in each case. That does not make sense. If you want to combine the two conditions with a logical OR operator, then try
=IF(OR(K2="Tuality Healthcare",K2="Sky Lakes Medical Center"),VLOOKUP(L2,Dropdown!E80:F84,2,0),"K2 has another value")
This doesn't error, it just gives me "FALSE" as a result. I'm thinking I can't do a vlookup from two different sources, but want to verify? If not, suggestions for an alternative? Thanks!
=IF(ISBLANK(A69),"",IF(ISNA(VLOOKUP(A69,sheets!J:J,1,FALSE)),IF(ISNA(VLOOKUP(A69,Lines!B:B,1,FALSE)),"No Match",IF(VLOOKUP(A69,sheets!J:J,1,FALSE),"Matches sheet",IF(VLOOKUP(A69,Lines!B:B,1,FALSE),"Line","No Match")))))
Which do you want to check first? Perhaps try MATCH as you only seem to want to verify the presence of a match, i.e.
=IF(A69="","",IF(ISNA(MATCH(A69,sheets!J:J,0)),IF(ISNA(MATCH(A69,Lines!B:B,0)),"No Match","Line"),"Matches sheet"))
That will show "Matches sheet" if A69 is found in both sheets, if you don't want that then reverse the order of the MATCHES/text.
...or use COUNTIF
=IF(A69="","",IF(COUNTIF(sheets!J:J,A69),"Matches Sheet",IF(COUNTIF(Lines!B:B,A69),"Line","No Match")))
You'd probably be better off doing each lookup in separate cell across the row. You could also use MATCH rather than VLOOKUP. There shouldn't be a problem with what you are doing other then incorrect nesting.
You may want to drop the ISNA tests and instead try wrapping all of your VLOOKUPS in NOT(ISERROR(...)). The formula I got is:
=IF(ISBLANK(A69),"",IF(NOT(ISERROR(VLOOKUP(A69,sheets!J:J,1,FALSE))),IF(NOT(ISERROR(VLOOKUP(A69,Lines!B:B,1,FALSE))),"No Match",IF(NOT(ISERROR(VLOOKUP(A69,sheets!J:J,1,FALSE))),"Matches sheet",IF(NOT(ISERROR(VLOOKUP(A69,Lines!B:B,1,FALSE))),"Line","No Match")))))
This formula produced a result of "Matches sheet" in my very limited test. You should check whether it produces the result(s) you are looking for with your data set.