How can I filter by a group of individual dates in Google Sheets? - date

I have a group of individual dates on one sheet, and I'm looking for a quick way to filter by each individual date (not the range) on another sheet.
Group of individual dates
Values I'm trying to filter
Thank you.
I tried separating the dates by comma and putting them into the 'filter by - exact date' part of the filter tool. It will only recognize one date, not multiple.

I'm guessing what you may want to do. But if you want to filter by formula your range according to the dates match your second range you can do something like this:
=FILTER (Sheet1!A:O,INDEX(IFERROR (MATCH(Sheet1!A:A,Sheet2!A:A,0))))
Change the ranges accordingly. I used sheet 2 as the set of dates you wanted to filter by

Related

Google Sheets - Expanding dataset according to months between 2 dates

I would like to be able to expand a dataset to include one row per "person" per month, filtered by Start and End Date.
Consider the example below:
This is the desired outcome
Inputs are a start and end date, which could be anywhere between the start of a given financial year (01/04/20XX) and the end of that financial year (31/03/20XY).
The output rows contain each month comprised between these 2 dates for which there is a matching entry in the input (see example output)
I have an example sheet here.
Any help would be appreciated, thanks
Try:
=ARRAYFORMULA(SPLIT(UNIQUE(QUERY(FLATTEN(IF(DAYS(C2:C4,B2:B4)>=SEQUENCE(1,1000,0),A2:A4&","&TEXT(B2:B4+SEQUENCE(1,1000,0),"YYYY-MMM")&","&D2:D4,"")),"where Col1 is not null")),","))
Result:
This works however the only limitation is you have to manually edit the formula to specifically define the End range. It crashes when I set it to use the whole column using the formula below:
=ARRAYFORMULA(SPLIT(UNIQUE(QUERY(FLATTEN(IF(DAYS(C2:C,B2:B)>=SEQUENCE(1,1000,0),A2:A&","&TEXT(B2:B+SEQUENCE(1,1000,0),"YYYY-MMM")&","&D2:D,"")),"where Col1 is not null")),","))
I am assuming this is because of the Query function which runs a Google Visualization API Query Language query across data making it very long and heavy processing.
Explanation:
To explain how this works using the formula from this link: Google sheets - List of dates between a list of start and end dates to get the dates between, but I changed the IF to return all combined 4 columns. Converted it to date format using TEXT (YYYY-MMM). I then used the UNIQUE to remove duplicates so it will only show the months. Then make use of SPLIT to split across 3 columns.
References:
Get dates between 2 dates
TEXT
UNIQUE
QUERY
SPLIT
Hope this helps!

add missing dates to my list of dates and numbers

I have lists of dates and corresponding numbers. I want to compare/contrast these lists. However, they don't all have entries/data on every date. Some have data for the same date, others don't. I want all of my lists to have all of the dates on a timeline, so I can create analysis charts against them. Is there a formula to add missing dates to a list? Do I need to create a boilerplate of my date range for the formula enter image description hereto check against?
thanks!
David

Conditional formatting google sheets, match date between two dates- mark that row that is matching

I am looking for a way to match any date in a column of dates with a bunch of start/end periods at columns next to it. If any match, mark my cell.
I have managed to do this for one row, but I would like it to look at a whole column (or set range ex X6-X10) and compare with a bunch of date-periods in two columns.
Any one with any ideas of how I can do that?
This is what I have come up with so far:
And I am using this formula:
=AND($X$6>=$R$6,$X$6<=$T$6)
But, as I said, this only works for one row today. I would like to look through all rows in the columns.
This formula should work:
=COUNTIFS(X$6:X,">="&R6,X$6:X,"<="&T6)

In Tableau, is there a way to only show the first and last date in the table output using the date filter

Tableau will generally show every single date within table output of the date ranges filtered for. Is there a way to only show the first and last date in the table for the date of ranges selected?
I created an image of the desired output in excel. Link below:
Desired output example
Thank you in advance!
The feature that will address your goal is called a Level of Detail (LOD) calculation. They have many uses and take various forms. I suggest reading about the in the online help.
But, to answer your question, the LOD calc to find the first (i.e. minimum) value in a date field called, say, Transaction Date, is;
{ MIN([Transaction Date]) }
The formula for the latest value is left as an exercise for the reader 😊

How to filter by current month automatically on pivot table google sheets?

As a data analyst, I would like to see the report in a pivot table automatically for the current month, so that I can take a look at it and don't have to change the date filter manually.
This is the formula to show the first day of the current month. (Which is the criteria I need, first of the current month)
=EOMONTH(today(),-1)+1
It works when I put this formula in any cell.
But when I put it in the pivot "filter by condition" option it doesn't work.
This is what I tried.
Text is exactly =EOMONTH(today(),-1)+1 (In formula box)
The date is exactly =EOMONTH(today(),-1)+1 (In formula box)
Here a screenshot of the options
Any help will be greatly appreciated.
I've never had great luck with the pivot table filter criteria in Sheets, I typically filter the data first if it's more advanced or use aggregating functions. In the Sheets pivot tables are better for quick analysis than dashboards.
There's probably a few ways to do it, but one of the easier ways would be to duplicate the data tab, clear the data and use a filter function to retrieve data. Update the Pivot table data source to the new tab. This will always only be the current month's data.
Basically you filter the data before the pivot table, with the [filter function][1].
=Filter(data , [date col]>=EOMONTH(today(),-1)+1 , [date col]< date(year(today()), month(today())+1,1)
You can also add a month column to the data and then filter on that column, however each month you would need to update the month filter in the pivot table.
=date(year([date cell]),Month([date cell]),1)
If you're using it for a 'dashboard' of sorts, I would generally recommend to create it yourself with aggregating formulas (sumifs, countifs, ect) and then you can use the more complex filters.
try custom formula:
=MONTH(A2)=MONTH(TODAY())
where A2 is first cell of column containing valid dates
You can try to Filter by a Custom Formula:
=month(DatePurchase)=month(TODAY())
Where DatePurchase is the Field Name.