Google sheets - copy data from rows to columns with column value condition - google-sheets

I have a sheet where I am getting payment data from customers with date, name and amount. This is transactional data and more rows keep coming to it.
I need to copy that data to a different sheet in columns so that all payments for each customer come in front for their name and all payments in one month appear in total monthly payment.
This sample sheet has the input data sheets of Product and Services and Target is something I need to prepare automatically for all new entries in frist 2 sheets.
https://docs.google.com/spreadsheets/d/1YInJUkCw0TaegYKHVw6JGHKIZ9Wz6xYiOrhcIW2ya64

Welcome Kokab, I suggest to compile with that formula
={"Product/services","Receipt No","Date","customer number","Name","Code","Payment";
QUERY({
ARRAYFORMULA({IF(ISBLANK(Product!A2:A),,"Product") ,Product!A2:F});
ARRAYFORMULA({IF(ISBLANK(Services!A2:A),,"Services") ,Services!A2:F})
},"select * where Col1 <> '' order by Col2")}
then perform a pivot table as following https://docs.google.com/spreadsheets/d/19dj_A1pYm5pLqb_S69EdBfn_C3K43CanL7qPDuZLDY8/edit?usp=sharing

Related

Google Sheets: Dynamic lookup across two (merged) sheets

I have two external GSheets that are set up as room bookings with a running date in col B and the different rooms ppl can book in col C-AX for Sheet1, C-X for Sheet2, as well as my own Sheet with a list of names (let's call it NameSheet).
Example:
Goal: I want to add an extra column in NameSheet that returns all dates within the next two weeks in which a person has booked a room as well as the room info. Like this:
I used IMPORTRANGE to import both Sheets into my own Sheet (Merged_Sheet) and then merge them dynamically using a simple query formula:
=QUERY({'Sheet1'!A:AX;'Sheet2'!A:AX},"select * where Col1 <>''")
(I had to expand Sheet 2 to AX in order to merge them.)
I then set up another sheet (Date_Filter) to dynamically filter on the next two weeks:
=filter('Merged_Sheet'!A:AX,'Merged_Sheet'!B:B<=today()+7*1)
Finally, I have so far only managed to add a column in my original NameSheet that counts the number of times a there is a partial match on a name in the Merged_Sheet:
=countif(Date_Filter!A:AX,"*"&Name&"*")
Now I'm stuck on how I can return the dates & room info on a partial match (the name columns in the room sheet are "[First Name] [Last Name]" while the employee sheet is set up as "[Last Name],[First Name]") across an entire sheet. I've tried using regexmatch, filter, contains, and even the query function again, but I keep getting function errors.
I would super appreciate any formula help. :)

Formula for automatic transfer of data from one sheet to another in Google Sheets

I would like to ask for help with regards to my attendance sheet.
How can I automatically transfer the data from the remarks column on Sheet 1 to the date columns on Sheet 2?
The list of subjects on Sheet 1 is not sorted so I want the transfer of data to coincide with the sorted list of subjects on Sheet 2.
Sheet 1
Sheet 2
This is the link of my sheet:https://docs.google.com/spreadsheets/d/1y3kaOG_-xduw-Su2E4qKWNyFg70eW2qam98JwZ0vFEU/edit#gid=0
Put it to B4 and then copy and apply to C4:D4
=ArrayFormula(IF($A4:$A="",,IFNA(VLOOKUP($A4:$A,FILTER(Sheet1!$A:$E,Sheet1!$B:$B=B2),COLUMNS(Sheet1!$A:$E),FALSE),)))

Google Sheets Pivot Table - Show dates in between

I have a pivot table with the cumultative number of shares for each stock and with different timestamps when a portfolio-change was made (invest or divest):
https://docs.google.com/spreadsheets/d/1IxdeBriRA9DgVclAWwfrz5ni1bZO94xwh0jFCghTLDg/edit?usp=sharing
Now I want to add the dates 'in between' (for every single weekday) the invest and the divest timestamps, where logically the cumultative numer of shares are more than zero.
Example 'Apple': I want the pivot table to show all the dates for every single weekday for Apple from 2013-05-08 to 2014-12-16 with the cumultative num of shares.
Example 'AT&T': Because there is no divest of AT&T Stocks, I want all the dates from 2020-04-06 to today.
I'd like to have this two examples with all the other stocks in one table to apply further functions. The purpose is to use the GOOGLEFINANCE function for the stock prices for each single day afterwards. But first, I need all the dates (where the number of shares is >0).
In the second sheet are the 'raw data'. I'm also fine if there is a better solution than using pivot table.
Thank you very much!
Greets Fabian
Please, see testFile.
Since your data contains large period of time, table with all dates included for all stocks would be really big and unusable so suggest to select one stock and create table for it.
Thus on testSheet in cell B1 you select stock name you are interested in.
In cell B2 select whether you want period for only historic data or up to date.
Following formula creates sequence of dates starting from first date for selected stock and up to date.
=ARRAYFORMULA(
IF($B$2="Today";
SEQUENCE(TODAY()-MIN(FILTER('Stock Track Record'!A:A;'Stock Track Record'!F:F=$B$1))+1;1;
MIN(FILTER('Stock Track Record'!A:A;'Stock Track Record'!F:F=$B$1));1)))
Then next formula gets values from your initial data.
=ARRAYFORMULA(
IFERROR(VLOOKUP($A$5:$A;
QUERY({'Stock Track Record'!$A:$F};
"Select Col1, Col2, Col3, Col4
Where Col6 = '"&$B$1&"'";0);2;0);""))
And following calculates cumulative number of shares:
=ARRAYFORMULA(IF(A5:A="";"";SUMIF(A5:A;"<="&A5:A;D5:D)))

Google Sheets query + array + sort + transpose?

I'm working on a dynamic dashboard in Google Sheets that uses response validation to choose an student's name from a drop-down, pulling the relevant information for that particular student and adjusting the graphs/charts. One of the sections of the dashboard shows a list of events and the dates they happened, in chronological order. The order of events changes based on the order the dates happened in, which are pulling from a separate sheet (called "Database"), meaning the order of the events changes for each student.
I'm trying to create a formula that will locate the row for the currently selected student in the Database sheet, create an array with the headers of the Database sheet (for the event names) and the one row that matches the selected student's name, put that array in order by chronological date, and then transposes it so that it's a list of events in one column and their date in the other column.
I've created a copy of the dashboard and removed/edited all student information. In the sheet called "Student Tracker", I'm working in cell J7 (colored purple). It needs to pull the dates for the selected student and the header row (to label the dates) from the sheet called "studentList".
Thanks in advance for any help you can provide!
try:
=QUERY(TRANSPOSE(QUERY(studentList!A:Q,
"select E,F,G,H,I,J,K,L,M,N,O,P,Q
where A ='"&C4&"'", 1)),
"select Col1,' ',Col2
where Col2 is not null
order by Col2 label ' '''", 0)
note that columns J and K are merged so one empty column needed to be included in outer QUERY

How do I create a multiple sheets that use a google sheet named TOTAL as the data source?

How do I create multiple sheets that use a Google sheet named TOTAL as the data source? Each sheet must contain the same three columns from TOTAL and other specific data, for instance, FLUX will have six columns, three from TOTAL and three custom columns added manually.
I used a query function to import the data from TOTAL to FLUX so that updating data in TOTAL will update it also in FLUX
The data in TOTAL are not fixed. It will change adding rows, which might change the order of the list. For instance, adding the row 13 in TOTAL will shift down the data in column A:C in FLUX, but not columns D:F
Is that a way to keep the reference out of the QUERY part?
Here an example: Click me
you would need to create ID system and then you would be able to match your query with rest of the static columns. in sheet SALES remove that query and put IDs in A column. then your query will be:
=QUERY(TOTAL!A1:D, "SELECT A, B, C, D WHERE C is not null", 1)
where column A contains IDs and then you create new sheet SHEET3 and paste this query in A1
and this formula in E1:
=ARRAYFORMULA(IFERROR(VLOOKUP(A1:A, SALES!A1:G, {4,5,6}, 0), ))
I have the same problem and I can't understand few steps from the answer.
Firstly, the A columns of both sheets (TOTAL and SALES) must have IDs?
Secondly, I can't really understand how the Sheets SALES should look like. Should it be like, Col A = IDs, ColB to C query from TOTAL and Col E to G static data?
In this case is it still correct creating a query in Sheet3 reading data from TOTAL?
Thank

Resources