Striving Hard to find a way to use array with COUNTIF - google-sheets

I have been using below formula to count the specific values in an range but i did not find an way to do this.
I used it with Array but the problem is how to convert this range C3:AG3to use an array formula i did this which is obviously wrong C3:C:AG3:AG there can be other way to use countif with Array but i could not find.
Someone can please help me with that issue.
=ARRAYFORMULA(IFERROR({"Count";IF(B2:B<>"",,COUNTIF(C3:AG3,"W")))

try in row 1:
={"count"; ARRAYFORMULA(IF(A2:A="",,
MMULT(IF(C2:AG="L", 1, 0), TRANSPOSE(COLUMN(C2:AG))^0)))}

Related

ArrayFormula for Google Sheets using Sum and IF

So I have these formulas here
=if(J3="","",sum(J3,M3:N3))
=if(A1="","",index('SHEET1?'!F:F,match(A1,'SHEET1?'!E:E,0)))
I have been trying to find a way to get this as an array but I can't seem to find the solution that works best with this specific format. The problem is that if I do the array formula as is, it shows the sum of the whole range instead of giving the sum per row.
Any help is appreciated. Thank you!
SUM is not supported by ARRAYFORMULA, use + or MMULT
=ARRAYFORMULA(if(J3:J="",,J3:J+M3:M+N3:N)))
Alternative:
=ARRAYFORMULA(if(J3:J="",,J3:J+MMULT(N(M3:N),N(TRANSPOSE(COLUMN(M3:N)^0)))))
INDEX is not fully supported by ARRAYFORMULA, use VLOOKUP
=ARRAYFORMULA(IF(A1:A="",,VLOOKUP(A1:A,E:F,2,FALSE)))

while using sumifs, how can i have multiple options for a particular criterion

I tried using the below formula but not getting correct value:
=SUM(SUMIFS(payments!$D$2:$D$1776,payments!$A$2:$A$1776,A7,payments!$B$2:$B$1776,{H7,H7-1,H7+1}))
H7 is a date.
Can anybody please help with how this works?
SUMIFS does not work with an array, you have to use SUMPRODUCT
Try =SUMPRODUCT(payments!$D$2:$D$1776*(payments!$A$2:$A$1776=A7)*(payments!$B$2:$B$1776={H7,H7-1,H7+1}))

How to get last item from array (reverse array) Google Spreadsheets

I am using the FILTER formula to get filtered data
=FILTER(A:H,REGEXMATCH(D:D,"......"))
This function returns multiple results from top to bottom of my document.
I need to get the last result from filter function.
How can I achieve this?
I have already tried to transpose, reverse array, etc. But didn't get desired result.
I would be grateful for any help with this matter.
In addition to the contribution of ttarchala, maybe this will also work
=INDEX(A:H,MATCH(2,IF(regexmatch(D:D, "..."),1),1))
=index(
filter(<your_range>, <your_condition>),
rows(filter(<your_range>, <your_condition>))
)
The disadvantage is that you have to repeat the filter parameters twice, maybe someone can improve on this answer?

SORT FILTER function with multiple conditions

I'm an enthusiastic novice working on a Google sheet. I realise this formula isn't pretty and there's probably a better and more logical way to do this. The formula I'm trying to use works in as much as it filters the correct rows I want, but I can't get them displayed in the order I want.
This works for the filter part...
=(FILTER(LBACCsV2!N11:AR,LBACCsV2!O11:O="I",(LBACCsV2!S11:S="MQ1")+(LBACCsV2!S11:S="MQ2")+(LBACCsV2!S11:S="MQ3")+(LBACCsV2!S11:S="MQ5")+(LBACCsV2!S11:S="MQ6")+(LBACCsV2!S11:S="MQ7")))
But, I want to sort by Column LBACCsV2!AB which is column 15. If I adapt the formula with SORT like this...
=SORT(FILTER(LBACCsV2!N11:AR,LBACCsV2!O11:O="I",(LBACCsV2!S11:S="MQ1")+(LBACCsV2!S11:S="MQ2")+(LBACCsV2!S11:S="MQ3")+(LBACCsV2!S11:S="MQ5")+(LBACCsV2!S11:S="MQ6")+(LBACCsV2!S11:S="MQ7"),15,TRUE))
It doesn't work and I get an error message which says...
"Error
FILTER has mismatched range sizes. Expected row count: 1013, column count: 1. Actual row count: 1, column count: 1."
Please don't shoot me down, as I said, I'm a novice who didn't what a spreadsheet was a while ago. Any help warmly appreciated, thanks.
I think you may have a misplaced closing bracket. The two parameters of the sort function appear INSIDE the filter function. Try
=SORT(FILTER(LBACCsV2!N11:AR,LBACCsV2!O11:O="I",(LBACCsV2!S11:S="MQ1")+(LBACCsV2!S11:S="MQ2")+(LBACCsV2!S11:S="MQ3")+(LBACCsV2!S11:S="MQ5")+(LBACCsV2!S11:S="MQ6")+(LBACCsV2!S11:S="MQ7")),15,TRUE)

[google spreadsheets]Joining Multiply Arrays in one formula

I am long looking for solution to a problem that states as this:
I have 3 different ranges in my spreadsheet (lets say they are on different sheets) and I want to join them all on the 4th sheet as one array (like one under another).
And here is my question how can I dot it? I want to then use filter on the given range to make all 3 ranges one sorted range and I want it to enlarge dynamically when I add new rows to one of the source ranges.
I basically tried to use Arrayformulas and query formulas but I didnt found any solution.
Does anybody have any clue or idea how to solve this problem?
Thanks in Advance
volmort
You can use "Embedded Arrays" to achieve this result.
Source Data in:
D6:F9
H6:J9
L6:N9
Formula to aggregate all data ranges:
=FILTER(
{ARRAYFORMULA(D6:F9);ARRAYFORMULA(H6:J9);ARRAYFORMULA(L6:N9)}
, {ARRAYFORMULA(D6:D9);ARRAYFORMULA(H6:H9);ARRAYFORMULA(L6:L9)} <> ""
)
Note: un-populated rows in the source data ranges are "filtered" from the results. An un-populated row is a row with no data in the first column of the range.
If this result is not desired, then a simpler version with ARRAYFORUMULA could be used:
=ARRAYFORMULA(
{ARRAYFORMULA(D6:F9);ARRAYFORMULA(H6:J9);ARRAYFORMULA(L6:N9)}
)
Here is an demonstration of the solution:
https://docs.google.com/spreadsheets/d/1HTyIpaLU0dm89ZY8ka9SI0J2nywnS9QteFY1h9BxdR0/edit?usp=sharing

Resources