I am new to Google sheets and trying to create a timeline line chart. The data is as follows.
Col1 defines Project, Col2 defines the hours left for the projects, Col3 defines the start date and Col4 defines the End time of the Project.
I am trying to create a line chart where each line represents a Project with the value on y-axis as Hours left and on x Axis it shows Date. The line height (on y-axis) will be defined by Hours Left and the length of line (on x-axis) will be defined by start date and end date (as below).
I've tried different combinations, but not reaching a proper solution.
I can also try to change the formatting of data, if that is the issue.
the line chart is based on series so you need to reorganize your data like this:
=QUERY(A2:D, "select D,max(B) where B is not null group by D pivot A")
Related
I am struggling with a Gantt chart/ sparkline distinguishing unique trade numbers and dates as it aggregates all the inputted data and illustrates either the earliest date and latest date so all the lines are the same. I would like these to be individual based on "Trade numbers"
The information should show the delivery schedule in the Gantt chart, whether it's buy or sell distinguished by 2 colours.
Start date (Trade Date)
End Date (Due Date)
The formula I have is:
=if(Countif(Query(filter(Consolidated_TradeTrack!$A$2:$G, ((Consolidated_TradeTrack!$B$2>=F$8)*(Consolidated_TradeTrack!$A$2<=F$8))), "Select Col5 Where Col5 = '"&$D9&"'"),$D9)>0, SPARKLINE(Consolidated_TradeTrack!$F$2:G$2,{"charttype","bar";"max",max(2);"color1",switch($D9,"Buy","#7E3F8F","Sell","#FE7F2D")})," ")
Formatted differently:
=if(
Countif(
Query(
filter(
Consolidated_TradeTrack!$A$2:$G,
(Consolidated_TradeTrack!$B$2>=F$8)*(Consolidated_TradeTrack!$A$2<=F$8)
),
"Select Col5 Where Col5 = '"&$D9&"'"),
$D9
)>0,
SPARKLINE(
Consolidated_TradeTrack!$F$2:G$2,
{
"charttype","bar";
"max",max(2);
"color1",switch($D9,"Buy","#7E3F8F","Sell","#FE7F2D")
}
),
" "
)
Info is sources from a tab called "Consolidated_TradeTrack"
Which looks like:
If I understood correctly, your objective is to accomplish the following behavior:
where the cell corresponding to that Date and Trade Number is colored with the respective buy/sell color if the date falls between Trade Date and Due Date.
This can certainly be accomplished with the SPARKLINE function, however, bear in mind that the SPARKLINE function will create a chart (you can read the documentation here). I presume that that is not what you want, as you would prefer the actual cells to be colored in.
That can be achieved with some conditional formatting (you can read the documentation about it here). In my example (int the G2 cell, the first of the Gantt Chart) I have set up two conditions; both with a G2:Q4 range, with the Format cells if in Custom formula is: and with the following formulas:
=AND(G$1>=$A2,G$1<=$B2,$E2="Buy")
and
=AND(G$1>=$A2,G$1<=$B2,$E2="Sell")
Of course, you can extend the range of the conditional and modify the colors of each condition.
I've got a Spreadsheet where on the sheet "Dados de Cadastro e Resumo" on column K (from roll 7 to 29) I'm using the formula =IF(J7="";"";SUM(QUERY({Caminhoneiro!G:I;Centralizado!G:I;Djoko!G:I};"Select Col2 where Col1 = '"&J7&"'";))) to sum up the hours from the sheets "Caminhoneiro","Djoko" and "Centrealizado".
The thing is, I want to make it so I don't have to edit the formula every time to accommodate for new sheets. My ideia was to use the names on column E (from roll 7 to 29) and make the reference for the Query based on that.
So far I've got the string done (on M6), but haven't been successful on turning that on to a valid array reference (using INDIRECT, which I later learned doesn't deal with multiple intervals.
I have a CSV file that I'm pulling from a database. It's in an awkward layout so I need to reorganise it and display the result in a separate sheet.
Here is a dummy example of the data structure I get.
https://docs.google.com/spreadsheets/d/1sTfjr-rd0vMIeb3qgBaq9SC8felJ1Pb4Vk_fMNXQKQg/edit?usp=sharing
It looks like that. The database grows every day by date and sometimes countries so I need to account to that in my formula.
I need to pull data per each country and display it by date.
I don't need data from Column A, C and D. And when there are multiple states I need to sum them up in one column.
It should look like this and keep growing downwards. I'm gonna use this table for a graph chart
What I've tried so far
=TRANSPOSE(QUERY(IMPORTRANGE("url_to_a_separate_sheet_where_I_importing_a_row_csv_file", "CSV-source-sheet!A1:500"), "SELECT * WHERE Col2='Germany'"))
This works, kinda. But pulls in unnecessary columns and I can't figure out how to sum countries with multiple states. When I add select sum(*) it gives me a big and long error. I assume it might be because of unnecessary columns that the formula cant sum up and I don't know how to omit them. I'm stuck
I tried offset and skipping no luck. Any ideas?
try:
=ARRAYFORMULA(TRANSPOSE(QUERY({Sheet2!B:B, Sheet2!E:BE},
"select Col1,"&TEXTJOIN(",", 1,
"sum(Col"&ROW(INDIRECT("Sheet2!A2:A"&COUNTA(Sheet2!1:1)-5))&")")&"
where Col1 is not null
group by Col1
label Col1'Date'", 1)))
spreadsheet demo
I'm having a problem getting Google Sheets to color the top 10 values in multiple columns.
I have columns that contain the following stock information:
Account,Ticker,Symbol,YTD,1 Yr,5 Yr,10 Yr,Risk,Return,Star Rating
Example:
T. Rowe Price U.S. Large-Cap Core Fund,TRULX,2.2,3.93,12.3,12.67,2,5,5
I would like to color the top 10 values for the 1 Yr, 5 Yr, 10 Yr columns.
I thought the function large(L:L,10) would do the job but it seems that the function needs to be sorted by the field that its coloring and it doesn't seem to work if the values in the column are formulas. All the data in these fields but the ticker are formulas.
Assume that data column is column A.
Here's step by step solution:
select your range, like: A2:A500
go menu Format → Conditional formatting...
Choose 'Format cells if...' = Custom formula is
Paste this formula: =$A2>=large($A$2:$A,10)
To check if the formula works right, you may use this formula, paste it into empty column:
=QUERY(sort(A2:A,1,0),"limit 10")
This formula will give you the list of top 10 values from column A. Change A to your column.
I got a Google Form that are pushing data into my Google Spreadsheet. It's very simple and consist of 3 cols named:
A -> Date
B -> Type
C -> Data
There is three different types, which all have same data but different values (3 types data per day). I want to use these data in a bar chart, where X is the date represented per day basis, and the Y axis is the data value. But the series should be based on type, which in the end should lead to three bars per day.
This is probably fairly simple, but since I'm quiet new to G-Sheets, I have no clue of what to look for.
Dataset looks like the following example:
04-06-2016 house 140
04-06-2016 car 185049
04-06-2016 rental 14267
etc....
Please, look at my Bar Chart Sample.
The result looks like this:
Suppose, Data is stored in range A:C. I suggest select free cell (E1) and paste there the formula:
=QUERY({A:C},"select Col1, sum(Col3) where Col2 <> '' group by Col1 pivot Col2")
It will convert Data, pivot it. Then select range wich you got with formula (E1:H8) and paste new chart, select bar type.