Google Sheets COUNT/FILTER function - google-sheets

I'm having some trouble getting these functions to work. I'm not even sure if they're the ones that I should be using, but here is the following information I can provide. I had previously opened a topic, but I was getting responses about my confusing query. So, hopefully this one is better explained.
I have data in the following fields: A1:N7, as well as A12:L18.
I need a function to check all of the fields and add up the amount of times certain numbers show up. The numbers that need to be checked are: <90, 90-99.99, 100-109.99, and =>100.
First off, I can use this formula to count the <90 and =>100 values in all the fields, which works.
=COUNTIFS(A1:N7,"<90")
However, I'm unsure how to appropriately add the results from A12:L18 into it. My attempts have failed. Likewise, for the ranged functions, I'm completely lost. I've tried something like this:
=COUNT(FILTER(A1:N7,A1:N7>=90,A1:N7<=99.99))
Yet, this always returns 0 as the result. In addition, like the above formula I don't know how I'd nest in a way to check the additional fields in A12:L18.

An old thread, but I came across it trying to solve a similar problem.
Using the original example:
=COUNT(FILTER(A1:N7,A1:N7>=90,A1:N7<=99.99))
I was also getting zero until I realised COUNT returns the number of NUMERIC values in the range. Assuming the result range isn't numeric, I tried:
=COUNTA(FILTER(A1:N7,A1:N7>=90,A1:N7<=99.99))
and got the result I was expecting.

You just need count rows your matrix with ROWS()
=ROWS(FILTER(...))

Does this formula work as you want:
={"<90",COUNTIF({A1:N7;A12:N18},"<90");"90-99.99",COUNTIFS({A1:N7;A12:N18},">=90",{A1:N7;A12:N18},"<100");"100-109.99",COUNTIFS({A1:N7;A12:N18},">=100",{A1:N7;A12:N18},"<110");"=>110",COUNTIF({A1:N7;A12:N18},">=110")}
I made an example sheet where you can see it working: https://docs.google.com/spreadsheets/d/1BPexh5syksapZ9rd_brAa3NkN28LXAvB6dVMLEkM2r0/edit#gid=0

Related

Xlookup issue with Indirect function in Google Sheets

I am utilizing a xlookup with indirect references function with certain date ranges to determine the range of rows to search in. With 3k rows of data and repeating values this helped me pair down to non-repeating values so I don't have an errant value from an earlier entry. The xlookup initially worked great when I manually inputted range of rows to search in but when indirect was introduced I am getting my error message I programmed (leading me to believe there isn't an error with my function)
When I utilize the direct references (meaning I'd have to change the date ranges directly in formula) it works great!
`=xlookup(T3,Statistics!F203:F215,Statistics!A203:215,"Not Scheduled",1,1)`
However when I use indirect to reference the specific range (so that I can adjust the date range over one cell and the reference rows recalculate) I get the error message I programmed.
`=xlookup(T3,indirect(Statistics!Q11&":"&Statistics!R11),indirect(Statistics!T11&":"&Statistics!U11),"Not Scheduled",1,1)`
Q11=F203
R11=F215
T11=A203
U11=A215
The correct answer lies in Row F205 which is within the ranges specified in the function.
Usually I figure these out or find a typo when utilizing my functions but I'll be honest and say this has me stumped. The references on the other page are identical. Just for note I also tried a Concateate function to combine the two cells before calling indirect with the same result. Any help would be greatly appreciated as this would add verification to a transportation system instead of double entry across two systems.
As far as I see it, what I think you're missing is the name of the sheet. You're referencing to the cells but not clarifying that the INDIRECT function has to look into "Statistics". Try adding it:
=xlookup(T3,indirect("Statistics!"&Statistics!Q11&":"&Statistics!R11),indirect("Statistics!"&Statistics!T11&":"&Statistics!U11),"Not Scheduled",1,1)
About that 1 after "Not Scheduled", are you sure you don't want an exact match only? Meaning to use a 0 instead of 1

Unpivoting using QUERY function is not fetching the expected result

I am currently working on a dataset that includes several columns, mostly the dates. What I am trying to achieve is - unpivot all the date columns to use for my subsequent calculations. I use the following formula to unpivot: =ARRAYFORMULA(SPLIT(FLATTEN(Data!A2:A&"|"&Data!D1:AG1&"|"&Data!D2:AG),"|"))
Even though this returns the expected result, when I try to nest this within a Query function, it does not work correctly. This is how I applied the formula - QUERY(ARRAYFORMULA(SPLIT(FLATTEN(Data!A2:A&"|"&Data!D1:AG1&"|"&Data!D2:AG),"|")),"Select * WHERE Col3 IS NOT NULL")
PS: When I change the data range to say, A2:A100, it gives me the correct result. However, it does not help since lot of new data would get added and I want the formula to be dynamic.
Here's the link to the sample sheet - https://docs.google.com/spreadsheets/d/1dgFY5mT9nUJtFefjAros-XpWXRMFtxEf8Fqrv82N5Ys/edit#gid=1813140523
Any help/suggestions would be highly appreciated
Not sure where you got your SPLIT(FLATTEN technique,
but you have to include both the 3rd and 4th parameters of the split function as FALSE or 0. so in your case it would be:
=ARRAYFORMULA(SPLIT(FLATTEN(Data!A2:A&"|"&Data!D1:AG1&"|"&Data!D2:AG),"|",0,0))
If you do that you'll find your query works.
Also note that the way you have it it's not really working. If you look all the way down in column 1 you'll find a bunch of dates formatted to look like integers.

Index / Match - Receiving an error when trying to find entry

I am very fresh with Excel and still learning the basics. I came upon an issue I really need help with and couldn't find suitable solution online.
I have a column I keep on constantly updating with Bulk data THE COLUMN.
I'd like to see the most common entry and the least common entry for a specific time using this formula:
=INDEX('Data Input'!F433:F610,MODE(MATCH('Data Input'!F433:F610,'Data Input'!F433:F610,0)))
But once I try it, it constantly tells me:
Did not find value '' in MATCH evaluation.
I've tried with shorter ranges and It did work, so I guess once it runs through empty cell - it breaks. How can I modify this formula to function properly and print what I need?
And side question, is is possible to implement a calendar bar and choose between dates?
You can insert a clause to exclude blanks (assuming they are not to be considered a legitimate return):
=INDEX('Data Input'!F433:F610,MODE(IF('Data Input'!F433:F610<>"",MATCH('Data Input'!F433:F610,'Data Input'!F433:F610,{0,0}))))
Note that I have used
{0,0}
for MATCH's match_type parameter so that the formula will not error should there be more than one entry within your range which shares the highest frequency. In such cases, the above formula will return that which occurs first in your list.

LOOKUP Function won't output correct value

I'm trying to create an Activity tracker for a game. However, I'm trying to use the LOOKUP function to track activity throughout 3 different sheets. However, the LOOKUP function does not seem to be outputting the correct value. LINK: https://docs.google.com/spreadsheets/d/1tdq6oeEFjgxJg6FXvSH2ZmkgRlHaFiD5aycjvezfNvc/edit?usp=sharing
If you look at Activity sheet, E2:E52, you should understand that it's outputting the wrong value(At least based on what I'm reading on the google docs).
I've tried converting this over to one sheet to see if that was the problem, however, it didn't work there either, I tried being more inclusive of the exact letter and number combination and that didn't help either.
I expect it to output the Attacks column for the username based on the Activity1 sheet.
Any help would be greatly appreciated.
PS: I tagged excel as it does the same exact thing on excel, however it gives slightly different values. I'm very confused.
use VLOOKUP instead:
=ARRAYFORMULA(IFERROR(VLOOKUP(D2:D,
{Activity1!C:D; Activity2!C:D; Activity3!C:D}, 2, 0)))

SUMIFS Values from non consecutive Column Cells

I need tu sum several cells that are separated one from another, these cells are
C3,F3,I3,L3,O3,R3,U3,X3,AA3,AD3,AG3,AJ3,AM3,AP3,AS3,AV3,AY3,BB3,BE3,BH3,BK3,BN3,BQ3,BT3,BW3,BZ3,CC3,CF3,CI3,CL3,CO3
if this other cells $C$1,$F$1,$I$1,$L$1,$O$1,$R$1,$U$1,$X$1,$AA$1,$AD$1,$AG$1,$AJ$1,$AM$1,$AP$1,$AS$1,$AV$1,$AY$1,$BB$1,$BE$1,$BH$1,$BK$1,$BN$1,$BQ$1,$BT$1,$BW$1,$BZ$1,$CC$1,$CF$1,$CI$1,$CL$1,$CO$1
that are on the same column but different row are >= to certain number given and <= to other given number, but it returns #Value, can somebody help me find out what am I doing wrong?
This is the function i am writing:
=SUMIFS((C3,F3,I3,L3,O3,R3,U3,X3,AA3,AD3,AG3,AJ3,AM3,AP3,AS3,AV3,AY3,BB3,BE3,BH3,BK3,BN3,BQ3,BT3,BW3,BZ3,CC3,CF3,CI3,CL3,CO3),($C$1,$F$1,$I$1,$L$1,$O$1,$R$1,$U$1,$X$1,$AA$1,$AD$1,$AG$1,$AJ$1,$AM$1,$AP$1,$AS$1,$AV$1,$AY$1,$BB$1,$BE$1,$BH$1,$BK$1,$BN$1,$BQ$1,$BT$1,$BW$1,$BZ$1,$CC$1,$CF$1,$CI$1,$CL$1,$CO$1),">="&B55,($C$1,$F$1,$I$1,$L$1,$O$1,$R$1,$U$1,$X$1,$AA$1,$AD$1,$AG$1,$AJ$1,$AM$1,$AP$1,$AS$1,$AV$1,$AY$1,$BB$1,$BE$1,$BH$1,$BK$1,$BN$1,$BQ$1,$BT$1,$BW$1,$BZ$1,$CC$1,$CF$1,$CI$1,$CL$1,$CO$1),"<="&C55)
I'm not 100% certain, but it looks like the problem here is that SUMIFS requires arguments to be expressed in continuous-range form, e.g. A3:CO3. It looks like you're trying to work with every third column in the dataset, yes? As far as I can tell, this is best (only?) done as an array function, so that you can tell it to filter on "every third column."
Enter this in the cell, then press CTRL+SHIFT+Enter (CSE) to evaluate it as an array function:
=SUM(($A$1:$CO$1>=B55)*($A$1:$CO$1<=C55)*(MOD(COLUMN(A3:CO3),3)=0)*(A3:CO3))
You'll also need to hit CSE every time you evaluate or change it. There's a decent tutorial for array functions at https://support.office.com/en-za/article/Guidelines-and-examples-of-array-formulas-7d94a64e-3ff3-4686-9372-ecfd5caa57c7, which may help if you're unfamiliar with them.

Resources