Using Filter on Google Spreadsheet - filter

I want to apply a filter to my Google spreadsheet.
Column J of my AllCurrent sheet has some rows with value 2016 so why isn't this working?
I threw in my =IF(MONTH(TODAY()) > 4,YEAR(TODAY())+1,YEAR(TODAY())) part in a cell and it evaluated to 2016.
Here's the filter: =filter(AllCurrent!A2:Z,AllCurrent!J2:J = IF(MONTH(TODAY()) > 4,YEAR(TODAY())+1,YEAR(TODAY())))

Does this formula work as you want:
=FILTER(AllCurrent!A2:Z,ARRAYFORMULA(VALUE(AllCurrent!J2:J) = IF(MONTH(TODAY()) > 4,YEAR(TODAY())+1,YEAR(TODAY()))))

Related

How to get uniques and sum based on criteria set in Google Sheets?

I'm trying to get these summed, but I can't wrap my head around it.
Here is a visual demo:
Here is the link to the sheet, in case you feel like jumping in:
https://docs.google.com/spreadsheets/d/1gh5w0czg2JuoA3i5wPu8_eOpC4Q4TXIRhmUrg53nKMU/edit?usp=sharing
I did an INDEX+MATCH, but of course this isn't going to get me anywhere:
=iferror(INDEX(E:E;MATCH(1;(F:F=I$6)*(A:A=$H$7);0));"-")
You can do two nested QUERY to find the uniques (by counting them), and only selecting them the column of numbers. The first QUERY also filters by date and type:
=SUM(QUERY(QUERY(A:F;"SELECT A,B,E,COUNT(A) where A = '"&H7&"' AND F = date'"&TEXT(I6;"yyyy-mm-dd")&"' group by A,B,E");"SELECT Col3"))
As an array to include more all the dates:
=MAKEARRAY(2;COUNTA(I6:6);LAMBDA(r;c;SUM(QUERY(QUERY(A:F;"SELECT A,B,E,COUNT(A) where A = '"&INDEX(H7:H8;r)&"' AND F = date'"&TEXT(INDEX(I6:6;;c);"yyyy-mm-dd")&"' group by A,B,E");"SELECT Col3"))))
Added working solution to your sheet here:
=MAKEARRAY(2;COUNTA(I6:O6);LAMBDA(r;c;SUM(LAMBDA(z;MAP(INDEX(z;;1);INDEX(z;;2);INDEX(z;;3);LAMBDA(a;e;f;IFNA(FILTER(e;a=INDEX(H7:H8;r);f=INDEX(I6:O6;;c))))))(UNIQUE({A:A\E:E\F:F})))))

Google Sheets - Find and match value with filter

I have try using query, vlookup and filter to get data from other tab sheets
I don't know how to get data with logic condition.
Here my sheets :
https://docs.google.com/spreadsheets/d/1sukCRlU1UuXS6IaR8xCYs8QScH4B2m60bqsrypDkzTM/edit?usp=sharing
Step 1 :
I have tab sheet with list of reward
Step 2 :
in the other tab sheet (cust_point), in column C i want to get value from tab sheet Reward where it use match and logic condition >= and <=.
Then here my expectation :
Problem :
First, i try with formula
=QUERY(Reward!A2:B, "SELECT A WHERE B <= '"&C2&"'", 1)
then the result just showed but doesn't match
Second, i try with formula
=FILTER(Reward!A2:B,C2>=Reward!B2:B)
Third, i try with formula
=IF(VLOOKUP(C2,Reward!B2:B,1,FALSE), C2>=Reward!B2:B)
They all formula doesn't get value with match data like my expectation
How can I achieve that?
use:
=ARRAYFORMULA(IFNA(VLOOKUP(10000-B2:B;
SORT({10000-Reward!B2:B\Reward!A2:A}); 2; 1)))

Get newest date in Sheet

i have a sheet with two tabs. In the first tab, i can select a site and i have a list of types. I have a second tab with many datas from each type (date, year, month week, and site attached to a type).
I would like in the first tab write a formula to automatically get the newest date of the type depending to the selected site.
I'm not good with formulas but i tried to write one, this one =IF((AND(C1=DATA!F:F),(B3=DATA!E:E)),LARGE(DATA!A:A),"") but i don't have result.
Anyone can help me with my problem please ? This is the link of my Sheet.
=INDEX(SORT(FILTER( DATA!A:A; DATA!F:F = $C$1; DATA!E:E = $B3); 1; FALSE);1)
=INDEX(SORT(FILTER( DATA!A:A; DATA!F:F = $C$1; DATA!E:E = $B4); 1; FALSE);1)
INDEX(array, [row])
Index gets the nth value in an array, when you pass in the value 1, it will get the top most value.
I created a sorted array by using the FILTER function. and the SORT function. I sorted it descending and only returned the dates in the FILTER function.

Creating a dynamically sorted and filtered list from a range using a single formula in Google Sheets

I'm trying to do something similar to this question: Google sheets using Filter and Sort together
I have an input range with two columns, and as output I want to create a dynamically sorted and filtered list from the input range, using a single formula.
See this document for the desired result: https://docs.google.com/spreadsheets/d/109xcbORFZxTjH0Vjd6PVqYlOxMIdK7aXqf5-jnMMPik/edit?usp=sharing
I tried the formula: =SORT(FILTER(B11:C100, B11:B100 = or(I11,I12,I13,I14)), 2, 0) but it doesn't work. What I am doing wrong here? Any help much appreciated.
try:
=ARRAYFORMULA(QUERY(B11:C,
"where lower(B) matches '"&TEXTJOIN("|", 1, LOWER(I11:I))&"'
order by C desc", 0))
You can modified or(,,,,) like follow:
=SORT(
FILTER(B11:C100,
((B11:B100 = I11)*1+(B11:B100 = I12)*1+(B11:B100 = I13)*1+(B11:B100 = I14)*1)>0
)
, 2, 0
)

extract elements from xml document

I have an xml document in which I want to extract every 10 elements. I used this code to extract the last 10 elements, but the idea is to get the next 10 ones just before them, I can't use pagination with linq since I get the whole document:
slideView.ItemsSource =
(from channel in xmlItems.Descendants("album")
orderby (int)channel.Element("catid") descending
select new onair
{
title = (string)channel.Element("name"),
photo = (string)channel.Element("picture")
}).Take(10);
any ideas please?
Thanks
Try .Skip(10).Take(10) towards the end of your query.

Resources