[enter image description here](https://i.stack.imgur.com/aGylq.jpg)
the formula must return 0. But it returned 146. I don't know what is problem
Related
I was researching a way to count the number of zeroes in a column of data, even if the data gets filtered. I found the following solution:
=SUMPRODUCT(SUBTOTAL(3,OFFSET(B2:B18,ROW(B2:B18)-MIN(ROW(B2:B18)),,1)),ISNUMBER(SEARCH("Pear",B2:B18))+0)
Where, B2:B18 is the total list of data and "Pear" is the criteria being counted.
Can someone explain how this formula is accomplishing this task?
Is there a simpler way of doing this?
I was able to determine that:
SUBTOTAL(3,OFFSET(B2:B18,ROW(B2:B18)-MIN(ROW(B2:B18)),,1))
is used to return an array of which cells are visible and hidden in the range. 1 is returned for visible and 0 is returned for hidden.
ISNUMBER(SEARCH("Pear",B2:B18))+0)
is used to return an array of which cells contain "Pear". If "Pear" is found, 1 is returned, else 0.
SUMPRODUCT(arrayofvisiblecells , arrayofcellswithPear)
is used to sum all of the times when the cell is visible AND "Pear" is present. 1*1 else you will be multiplying by a 0.
With Office 365 we can finally get rid of the volatile OFFSET by using BYROW instead:
=SUMPRODUCT(BYROW(B2:B18,LAMBDA(a,SUBTOTAL(3,a))),ISNUMBER(SEARCH("Pear",B2:B18))+0)
The BYROW(B2:B18,LAMBDA(a,SUBTOTAL(3,a))) does the same as SUBTOTAL(3,OFFSET(B2:B18,ROW(B2:B18)-MIN(ROW(B2:B18)),,1)) without being volatile.
=SUMPRODUCT(SUBTOTAL(3,OFFSET(Sheet1!$A$1:$A$1006,ROW(Sheet1!$A$1:$A$1006)-MIN(ROW(Sheet1!$A$1:$A$1006)),,1)),ISNUMBER(SEARCH(B861,Sheet1!$A$1:$A$1006))+0)
B861 is what ever cell you are referencing.
I want a formula that, if the first or second cell is similar to the third, return 1, and if not, return 0, and if the cell is empty, return 0
I tried this formula and it was correct to some extent, but the only thing I want is that it returns 0 in the following empty or blank cells as well.
You can use this Formula
=IF(OR(AND(A1="",B1=""),C1=""),0,IF(OR(A1=C1,B1=C1),1,0))
So I am trying to find a formula that I will put in cell A6, that will search the cells A3:G3 for a max value and will return the value of the cell above the max value. In the case of the example photo i want the formula to be able to return the value of E2 sice E3 is the highest value.
See photo here!
Also, in case of same values, I would like it to return all days separated with a comma or something.
I hope my description wasn't very confusing. Thank you for your time and help.
Why don't try the simple max to achieve the result.
=MAX(A3:G3)
Okay to get the right result, you have to do the following.
=INDEX(A2:G2,MATCH(MAX(A3:G3),A3:G3,0))
Since your data is more likely in Row, so VLookup is not useful and Hlookup won't get max. Index Match formula is used to get Max.
If no extra cell for intermediate calculation, textjoin function will be needed:
=textjoin(",",TRUE,if(A3:G3=max(A3:G3),A2:G2,""))
for the worst, just change max to min
and this is array formula, ctrl+shift+enter is required
I have reference based index function in an xlsx spreadsheet
=SUM(B10:INDEX(B10:AJ10,$D$5-1))
However importing this spreadsheet in google sheets broke the function as Index doesn't return reference any more instead return the value at the index.
I wonder how can I solve this problem in google sheets.
That formula doesn't look correct. You are using the INDEX function for the extents of the range in a single row but you are returning the row number, not the column number to extend to.
=SUM(B10:INDEX(B10:AJ10, , $D$5-1))
That small modification should correct the range. With 7 in D5 this would be SUM(B10:G10) in Excel.
However, Google-Docs cannot use INDEX like that. Use the OFFSET function instead.
=SUM(offset(B10:AJ10, 0, 0, 1, $D$5-1))
I asked a similar question before this but it turned out that whatever formula I was using does not give me the correct result. So I have to reask the question and make it more specific.
Suppose I have the following spreadsheet:
I want a formula which gives me the latest date that have percentage change that is greater than zero and "Orange" is not mentioned in the "Comments" column. Only 1 of the percentage changes (Column Pct1 to Pct 5) needs to be >0. So the formula will output 11/20/2012 since it has % change that is greater than 0% and it is non-Orange.
I tried match, offset, max but it didnt give me the correct result. I am hoping to input this as a formula into VBA because I have a total of 20 excel files that I need to have the macro to check against. Please help me! Thanks!!
{=MAX((B2:F6>0)*(ISERR(FIND("ORANGE",UPPER(G2:G6))))*(A2:A6))}
Enter with Ctrl+Shift+Enter, not just Enter. Don't type the curly braces, Excel will insert them if you enter as an array formula.
The first section returns a matrix of TRUEs and FALSEs based on whether the percentages are greater than zero.
The second section returns TRUEs and FALSES based on whether FINDing "Orange" generates an error.
The last section returns an array of the dates.
When you multiply the arrays/matrices the TRUEs are 1, the FALSEs are 0 and you end up with an array of dates where all the conditions are TRUE. Finally, MAX picks the largest.