I have a list of typed data
type date value
A 1/1/2018 42
B 1/1/2018 12
C 2/2/2018 32
A 3/3/2018 48
C 3/3/2018 21
A 4/4/2018 12
Is it possible to create a graph showing the evolution of value of each type (A, B, and C => 3 curves) with respect to time (column date).
If possible, I would like to keep that table format.
Related
I'm trying to write a formula in Google Sheets which can first locate the row of a specific value. Then index to the value contained on that row a few columns over.
Let's assume the following
A B C
1 12 80
2 43 35
3 64 15
4 13 56
5 44 93
6 86 48
7 14 31
8 41 3
9 63 56
10 11 46
Values in column B and C have a correlated relationship. I need to first locate a specific value in column B than find it's corresponding value on the same row in column C.
For the sake of example, let's assume I'm trying to locate the row containing the value 41 in column B. And then would like to return the corresponding value in column C, which in this case would be 3.
The reason why I need a formula like this is because the data I'm using is highly variable and large. Over 4000 rows. It is unknown what rows the values to be found sit on.
You may try either:
=filter(C:C,B:B=D2)
OR
=xlookup(D2,B:B,C:C,)
filter() will output all instances of rows(column C) which has 41 in column B while xlookup will pick just the first match of 41 within the column
Expected result (formula cells being bold):
SHEET 1
SHEET 2
Key
Expected value
Key
Misc data
Expected value
12
C
10
asd
A
14
E
11
asd
B
10
A
12
asd
C
13
asd
D
14
asd
E
The formula I'm trying to use is
=LOOKUP(A2,'Sheet2'!$A$2:$A,'Sheet2'!$C$2:$C)
When I use this on a single sheet (tab) then it works as intended. However as soon as I'm trying to get data from another sheet, it fails with:
Error
Did not find value 'KEY' in LOOKUP evaluation.
The issue was with the key columns holding values with different data types (number vs plain text). After setting both to same data type, the formula started working.
This question already has answers here:
Query is ignoring string (non numeric) value
(2 answers)
Closed 5 months ago.
I'm trying to get the count of non-empty cells in a column of mixed numbers and text in a Google Sheets document using the QUERY function, but I'm getting some results I don't understand from the count aggregate function inside the query.
I've reduced my issue to this example to demonstrate the problem (or at least show where my misunderstanding is):
.
A
B
C
D
E
F
1
10
10
10
10
10
aa
2
20
20
20
20
bb
bb
3
30
30
30
cc
cc
cc
4
40
40
dd
dd
dd
dd
5
50
ee
ee
ee
ee
ee
6
7
select count(A)
select count(B)
select count(C)
select count(D)
select count(E)
select count(F)
8
=query(A1:A5,A7)
=query(B1:B5,B7)
=query(C1:C5,C7)
=query(D1:D5,D7)
=query(E1:E5,E7)
=query(F1:F5,F7)
9
5
4
3
5
5
5
This gives me the expected value in cells A9, D9, E9 and F9, but I've got a couple of questions:
what is going on in columns B and C to cause them to give counts of 4 and 3 respectively?
how do I modify my function / query to count the number of non-empty cells in the query range regardless of data types?
I know there are other functions like COUNTA that could solve this simple case, but my actual scenario is more complicated and is part of a larger QUERY function, and it's highlighted to me that the behaviour of query("... count() ...") isn't what I expected, so I'm trying to understand that specifically.
Try below formula-
=QUERY(INDEX(TEXT(B1:B5,"#")),"select count(Col1)")
QUERY() function is auto detecting these columns as numbers so it is excluding text strings.
I have a spreadsheet with 3 columns, Column A has values that increment by 10 and column b has the incrementation difference AKA...
Column A
Column B
Column C
125
135
5
135
145
6
145
155
7
Ext... (There are hundreds of rows with these incrementing values)
I also have a value that is placed in an arbitrary place such as "137" we'll call it D1
I need to cycle through the columns some how and find out...
If D1 is => 135 and less than 145 and if so, place the value of column C in another cell AKA(E1).
If D1 is => 135 and less than 145 and if so, place the value of column C in another cell AKA(E1).
Try the following in E1:
=arrayformula(if(isbetween(D1:D,135,145,1,0),C1:C,))
EDIT
i need to cycle through columns A and B and find where my D1 number fits and output the corresponding C value to E1
Try:
=arrayformula(vlookup(D1:D,{A1:A,C1:C},2))
I have a Google Sheet with two columns of data. A is monotonically increasing with many duplicates (based on a coarse timestamp), while B is essentially random. There are many empty rows at the bottom waiting for future data. It resembles the following:
A B
1 5 43
2 5 77
3 13 8
4 21 34
5 27 68
6 27 90
7
8
9
10
I'm trying to write a few formulae which examine all of the (non-empty) values in a column except for the last one. For example, I would like to find the maximum value of B excluding the latest value, so the result should be 77 from B2 instead of 90 from B6.
If the values in the range were strictly increasing and unique, I could filter the values of A into C, excluding any values equal to the maximum value (only the last entry), and then take the MAX(..) of that range. However, my data does not have that property; the final value could be duplicated and the duplicates would be inappropriately ignored.
C D E
1 =FILTER(A:A, A:A < MAX(A:A)) =MAX(C:C) This produces A4's 21 instead of A5's 27.
A similar approach would work if we had a third column of incrementing indices to use:
A B C D E
1 5 43 9 =MAX(FILTER(C:C, A:A <> "")) Value of index in last populated row.
2 5 77 10 =MAX(FILTER(A:A, C:C < D1)) Maximum value from a row with lower index.
3 13 8 11
4 21 34 12
5 27 68 13
6 27 90 14
7 15
8 16
9 17
10 18
But I'm looking for a solution that doesn't require modifying the original spreadsheet, because that's not always possible. I can't just create a new IndexSheet with nothing but an an index column and join it in like this instead...
A B C
1 5 43 =MAX(FILTER(IndexSheet!A:A, A:A <> ""))
2 5 77 =MAX(FILTER(A:A, IndexSheet!A:A < C1))
...
...because that requires that the IndexSheet have the same number of rows as the data sheet, and would break as more data is added.
Without modifying the original data sheet, or relying on properties of the data (beyond values being numeric and rows being empty or full), is there any way to perform an aggregate calculation on a range while excluding the last value?
You can use indirect and address formulas to create dynamic range excluding the last row
=max(indirect("A1:"&Address(count(A:A)-1,1)))
The count function gives the number of non empty cells in the column A. You subtract 1 to exclude the last row.
You use that number to build an address using "A1:"&address(row no, Col no) which in your example case should be A1:$A$5
Use this string to reference your cells using the indirect method indirect(A1:$A$5) and pass the reference to the max function to determine the max in that range.
From another sheet try:
=MAX(Sheet1!B1:indirect("Sheet1!B"&count(Sheet1!B:B)-1))
We can use the FILTER() and ROW() functions to accomplish this:
D
1 =MAX(FILTER(Data!A:A,
ROW(Data!A:A) < MAX(FILTER(ROW(Data!A:A),
Data!A:A <> ""))))
We use FILTER(ROW(DATA!A:A), Data!A:A <> "")) to get an array of row numbers of non-empty rows, and use MAX(...) to take the last row number. We use this to exclude the last row by filtering out values from lower row numbers with FILTER(Data!A:A, ROW(Data!A:A) < ...). We apply MAX(...) to this filtered array and get the result we were looking for.