If Today() matches Date (given as a number and string format), then import X - date

I am trying to get my head around this.
I have a table that (for some reason unknown to me) the owner writes the date in a String and Numeric format (Sunday 08/11/15). I can't edit this doc, but I need to extract names that correspond with dates from it.
I'm currently trying to use filter to grab a partial match:
=filter('sheet 1'!$A$3:$A$9,search($B$2,'sheet 1'!$A$3:$A$9))
This is ran in Column F, and pulls the contents from Sheet 1 into the current sheet (lets call it sheet 2) if Column B (which uses Today()) date matches. This part seems to be working perfectly fine.
What I then need to do, is match the contents of column F against the names in Sheet 1 that correspond with that date.
Sheet 1 looks like:
| Date | Team IOH | Team OOH | Team 1 IOH | Team 2 OOH |
|------------------|----------|----------|------------|------------|
|Monday 02/11/15| Dave | CTeam | BTeam | BTeam 2 |
|Tuesday 03/11/15| Dave | CTeam | BTeam 2 | BTeam |
|Wednesday 04/11/15| CTeam | CTeam | BTeam | BTeam 2 |
So, the date pulled from Sheet 1 as Wednesday 04/11/15 needs to pull those corresponding teams.
Sheet 2 looks like:
| Team | Date | IOH | OOH | BUTeam | F (Hidden colum) |
|--------|----------|---------|---------|--------|------------------|
| Team | =TODAY() | Dave | CTeam | CTeam |Monday 02/11/15|
| Team 1 | =TODAY() | BTeam | BTeam 2 | CTeam |Monday 02/11/15|
| Team 2 | =TODAY() | BTeam 2 | BTeam | CTeam |Monday 02/11/15|
So if =TODAY() was Monday (for example) it would pull the names from Sheet 1 Team IOH, and palce that in the IOH column of sheet 1. And the same for the following.
Sorry, probably could have explained this better but my brain is frazzled.

See my previous question with some tinkering around, I managed to get the transpose working . Rather than close this, I will answer it and leave it in case anyone has a question around how to find Partial Matches (As I don't see it very often)

Related

How to represent repeating month in ISO 8601

I try to promote the usage of ISO8601. How can every month of any year and halves of theses months be representated in ISO 8601?
We use a perpetual calendar in Excel where there are 2 column headers : first row is January, February, etc. and below a column subdivided into 2, something like this following example:
| Tasks | January | February | March | ...
| | | | | | | | ...
| task1 | | X | | X | | | ...
| task2 | | | X | | | | ...
How to best merge these header rows into in a meaningful row, written Jan-<first half> | Jan-<second-half> | etc. in an easily readable form. I think January-01 | January-02 is obviously not the answer. If this is not the right way to do it, please, describe how to deal with this kind of repetition.
This question is different from the one about representing date ranges I've redirected to as in the later start and end years/dates are indicated. My question is about recurring approximate date spans.
Thanks

Combine multiple rows into single row in Google Data Prep

I have a table which has multiple payload values in separate rows. I want to combine those rows into a single row to have all the data together. Table looks something like this.
+------------+--------------+------+----+----+----+----+
| Date | Time | User | D1 | D2 | D3 | D4 |
+------------+--------------+------+----+----+----+----+
| 2020-04-15 | 05:39:45 UTC | A | 2 | | | |
| 2020-04-15 | 05:39:45 UTC | A | | 5 | | |
| 2020-04-15 | 05:39:45 UTC | A | | | 8 | |
| 2020-04-15 | 05:39:45 UTC | A | | | | 7 |
+------------+--------------+------+----+----+----+----+
And I want to convert it to something like this.
+------------+--------------+------+----+----+----+----+
| Date | Time | User | D1 | D2 | D3 | D4 |
+------------+--------------+------+----+----+----+----+
| 2020-04-15 | 05:39:45 UTC | A | 2 | 5 | 8 | 7 |
+------------+--------------+------+----+----+----+----+
I tried "set" and "aggregate" but they didn't work as I wanted them to and I am not sure how to go forward.
Any help would be appreciated.
Thanks.
tl;dr:
use fill() function to fill all empty values within each d1-d4 columns in the wanted group (AKA - the columns date+time+user) then dedup\aggregate to your heart's content.
long version
So the quickest way to do this is by using a window-function called "fill()".
What this function does for each given field in a column, it tells it:
"Look down. look up. find the closest non-empty value, and copy it!"
you can ofcourse limit it's sight (look only 3 rows above, for example) but for this example, don't need the limitation. so your fill function will look like this:
FILL($col, -1, -1)
So the "$col" will reference all the chosen columns. the "-1" says "unlimited sight".
finally, the "~" says "from column D1 to column D4".
So, function will look like this:
.
Which in turn will make your columns look like this:
.
Now you can use the "dedup" transformation to remove any duplications, and only 1 copy of each "group" will remain.
Alternatively, if you still want to use "group by", you can do that aswell.
Hope this helps =]
p.s
There are more ways to do this - which entails using the "pivot" transformation, and array unnesting. But in the process you'll lose your columns' names, and will need to rename them.

Crystal Reports - Dynamic Grouping depending on Summary field

Trying to group dynamically depending on the field I sum using Summary. Example: table looks like
Person | Date 1 | Category 1 | Date 2 | Category 2 |
John | 1/1/2010 | minor | 1/1/2015 | major |
Paul | 1/1/2010 | minor | 1/1/2015 | minor |
I want to group dynamically by [major; minor] using sum of entries, like:
| 1/1/2010 | 1/1/2015 |
major | 0 | 1 |
minor | 2 | 1 |
This is a simple example but there could be dynamic categories from the input dataset, not just 2 hardcoded values.
Not sure if this is possible in Crystal Reports.
Thanks!

If dates match get data

I have two separate GoogleSheets documents. One with a list of dates and names (let's call this Doc1), the other with a list of names and contact numbers (we'll call this Doc2). Here's what I'm trying to do:
In Doc2. Pull the name from Doc1 corresponding with today's date. Then pull the contact number from Doc2 and put it next to the name.
Sounds simple enough, but I've tried to do this with vlookup to no avail, and was wondering if someone here could point me in the right direction?
For clarification, Doc1 looks something like:
| Day | Date | Team 1 | Team 2 | Team 3 |
|---------------|---------------|--------|--------|--------|
|Monday | 2 Mar 2015 |Bob |Adam |Dave |
|Tuesday | 3 Mar 2015 |John |James |Mike |
|Wednesday | 4 Mar 2015 |Philip |Dan |John |
Doc2 looks something like:
| Team | Todays Date | Name | Contact No |
|---------------|---------------|--------|------------|
|Team 1 | 03/03/2015 | | |
|Team 2 | 03/03/2015 | | |
|Team 3 | 03/03/2015 | | |
The contact numbers are listed on other pages in Doc2, next to the names.
So, what I'm trying to figure out is how in Doc2, to match today's date against the row with corresponding date in Doc1 and pull the name from Doc1 into Doc2, then pull the number from Doc2 that corresponds with the name that has now been pulled.
EDIT
This is what the sheet looks like, accurately. The column letters are listed exactly as they are on the sheet I am working with: E,H,K,N,Q,T,W,Z,AC,AF,AI,AL,AO,AR being used as dividers. Awkward, I know. But someone else made the original sheet and I can't edit it.
pnuts script worked, and returned the first name Bob, but for the team underneath it returned the Initials in the Hit category (in the example, BB). And for every entry after that (save the very next one, which returned blank) it returns REF# with the error: "Function INDEX parameter 3 value is 5. Valid values are between 0 and 4 inclusive." with the value of 5 goign all the way upto 15. (There are 14 teams, plus the title, which I guess makes it upto 15)
A B C D E F G H I J
| Day | Date | Team 1 | Hit | Team 2 | Hit | Team 3 | Hit |
|-----------|---------------|--------|------|--------|------|--------|------|
|Monday | 2 Mar 2015 |Bob | BB |Adam | AD |Dave | DV |
|Tuesday | 3 Mar 2015 |John | JN |James | JM |Mike | MK |
|Wednesday | 4 Mar 2015 |Philip | PH |Dan | DN |John | JN |
The layouts and different documents don't help but perhaps would get you started, assuming Day is in sheet S1 of Doc1 and Team in A1 of Doc2, please try in C1 and copy down to suit (UNTESTED):
=transpose(index(importrange("<key>","S1!b1:e"),index(match(B2,importrange("<key>","S1!b2:b"),0)+1),row()))
You would have to provide the appropriate key value and authorise the link.

Finding the last seven days in a time series

I have a spreadsheet with column A which holds a timestamp and updates daily. Column B holds a value. Like the following:
+--------------------+---------+
| 11/24/2012 1:14:21 | $487.20 |
| 11/25/2012 1:14:03 | $487.20 |
| 11/26/2012 1:14:14 | $487.20 |
| 11/27/2012 1:14:05 | $487.20 |
| 11/28/2012 1:13:56 | $487.20 |
| 11/29/2012 1:13:57 | $487.20 |
| 11/30/2012 1:13:53 | $487.20 |
| 12/1/2012 1:13:54 | $492.60 |
+--------------------+---------+
What I am trying to do is get the average of the last 7, 14, 30 days.
I been playing with GoogleClock() function in order to filter the dates in column A but I can't seem to find the way to subtract TODAY - 7 days. I suspect FILTER will also help, but I am a little bit lost.
There are a few ways to go about this; one way is to return an array of values with a QUERY function (this assumes a header row in row 1, and you want the last 7 dates):
=QUERY(A2:B;"select B order by A desc limit 7";0)
and you can wrap this in whatever aggregation function you like:
=AVERAGE(QUERY(A2:B;"select B order by A desc limit 7";0))