I create a spreadsheet(y) populated by a query from another spreadsheet (z)
The cells From A to D are populated by Query order by name.
Something like
A
Acme
Boo
Foo
from cell D to G I create formulas to generate a value for each cell.
something like
A D
Acme Myformula1
Boo Myformula2
Foo Myformula3
When add a value to main spreadsheet (z), the spreadsheet(y) with a query update its cells. For instance, I add AABB as value, the spreadsheet(z) will be:
A D
AABB Myformula1
Acme Myformula2
Boo Myformula3
Foo
It's wrong because Myformula1 is for Acme, myFormula2 is for Boo and so on.
is it possible to anchor myFormula1 to Acme?
Thanks
The best way is to write your formula on spreadsheet (z) and use VLOOKUP from spreadsheet (y)
Related
I have data in google sheets, looking like this:
A
B
C
D
E
F
G
TP
14656
18885
14317
19312
13303
14311
FN
12216
20107
14066
16323
11180
3478
and I want to implement the following formula:
which would manually look like this:
=(B1/(B1+B2))+(C1/(C1+C2))+...+(G1/(G1/G2))
However, I need this formula to be scalable. I've tried to use ARRAYFORMULA and SERIESSUM but could not manage to actually iterate over the row. Does sheets even support this, and if so, how does sheets implement iterating sums?
You can do the following:
=Sum(ArrayFormula(B1:G1/(B1:G1+B2:G2)))
Update:
If you want the range to be dependent on a manually entered j, use:
=Sum(ArrayFormula(Indirect("R1C2:"&"R1C"&j+1,0)/(Indirect("R1C2:"&"R1C"&j+1,0)+Indirect("R2C2:"&"R2C"&j+1,0))))
This assumes that the table in your post starts in A1 (R1C1).
In Google Spreadsheets, I want to read a cell containing the string 'e' into a formula which uses the 'e' as the horizontal component of a cell reference, eg 'e12'.
Hopefully clearer example:
a1 contains 'e'
a2 needs to contain 'e2'
then a2:a10 can contain 'eX' where X is 2 to 10.
I'm aware of the INDIRECT method, but I can't see how to use that to populate a2:a10 without a corresponding column of cells all containing 'e', one for each aX.
Perhaps I'm barking up the wrong tree.
I've got a table with list of names on the x axis and dates of meetings on the y axis. In each table element we have some string value to represent if they attended the meeting - eg "y" for attended the meeting "n" for did not, "a" for apologised for abscence in advance.
I also have a list, corresponding to the names on the x axis, of attendance, eg person1 has been to 60% of meetings. The trouble is that for every new meeting I insert a new column closest to the names list, and move all the other meetings one cell to the right. This means that for every new meeting, I have to update the formula with a new cell reference.
Before inserting a new meeting date, the formula looks roughly like DOSOMETHING(b2:y2). I then insert a column to the left of the b column. Google sheets cleverly updates the formula so to be DOSOMETHING(c2:z2), even though I really want the range to be b2:z2. I have tried DOSOMETHING($b2:y2), but inserting the column still causes this problem.
Thank you
instead of:
=DOSOMETHING(B2:Y2)
use this:
=DOSOMETHING(OFFSET($A2,0,1,1,99999))
the offset reference won't get messed up by the insertion of a column since it referrences column B by OFFSETing from column A. 99999 is just an arbitrarily large number that means "all the way to the right of the sheet.
you can read about offset here.
try like this in row 2:
=INDIRECT(A1&ROW()&":"&A1&10)
in Google Sheets using formulars I would like to build an array of the columns that fulfills a simple criteria, so for example:
A
B
C
D
E
F
G
h1
h2
h2
h1
h3
h2
h1
Then I would like to have the array {A:A,D:D,G:G} if I search for 'h1'
I suppose what you want is to get the Column letter of the cell if some criteria is met. Like :"what colums have the right answer?" and the return that letter in some way.
So as far as i know sheets does not provide that as a simple function. (But im not very skilled in sheets).
Heres a hacky thing that might work for you:
Somwhere in your sheet (eg bottom row # 100 make cells that hold your letters
So A100 holds "A" or "A:A" B100 holds "B" or "B:B" and so forth.
then you can use filter function.
If the row you want to want to investigate is the first:
code:
=FILTER(A100:Z100;A1:Z1="h2")
that will give you your array.
Cheers Mads
Suppose your raw data is in a sheet named Sheet1.
In a new sheet (e.g., Sheet2), place the following formula in A1:
=IFERROR(FILTER(Sheet1!A:G,Sheet1!A1:G1="h1"))
You could also place this version of the formula in Sheet2 cell B1:
=IFERROR(FILTER(Sheet2!A:G,Sheet2!A1:G1=A1))
... and then enter "h1" (or some other text to match) into cell A1.
ADDENDUM (after further comment from OP):
=IFERROR(FILTER(REGEXREPLACE(ADDRESS(1,COLUMN(Sheet2!A:G),4)&":"&ADDRESS(1,COLUMN(Sheet2!A:G),4),"\d",""),Sheet2!A1:G1="h1"))
heres a pice of code that will give you the column letter for any column.
Maybe you can use this in your code, or you can paste it in a cell and copy drag vertically it to get the column letters, like i sugested in previous post.
=IF(TRUNC((column()-1)/26)<1;CHAR((MOD((column()-1);26))+65);CHAR(TRUNC((column()-1)/26)+65)&CHAR((MOD((column()-1);26))+65))
Good Luck :)
I have a following formula in my google sheets
=TEXTJOIN(" -- ",TRUE,QUERY('sheetName'!B2:F,"SELECT F WHERE B = '"&$A3&"'"))
The formula is in a different sheet, same workbook though, let's call it "sheetResult". Basically it looks-up values and returns them if there is a match. There are two things I would like to achieve with it further. I need it to be an array so that it applies to all of the rows and I need it to return only the unique values found, I have tried the following but it does not work.
=ARRAYFORMULA(IF(A2:A = "" , , TEXTJOIN(", ",TRUE,UNIQUE(QUERY('sheetName'!B2:F,"SELECT F WHERE B = '"&$A2&"'"))) )) --> not sure what syntax to use
I tried filter but filter just returns all of the info stacked up, need the formula to return the data considering the rows in which the lookup value is held.
EDIT: Added a link to shared file to better describe the question.
I want to make the formula in Y3 on the "Students" sheet apply to all of the cells below it, much like an array formula does.
Example
After further studying your situation I came with a simple fix based on your original formula. I understand that you want to apply the Y3 formula to the whole table, but without altering its behaviour. I assume that the only moving part would be the students ID (Column A). Then you only need to modify your formula to lock the fixed variables with something like:
=TEXTJOIN(" -- ",TRUE,UNIQUE(QUERY('.data'!$B$2:$F,"SELECT F WHERE B = '"&A3&"'")))
After you write that on Y3 you would need to select it and drag it down to fill the table. Please leave a comment if you need further help.
I have an Google sheets file with two sheets. I'm trying to reference one sheet's text based on two cells of criteria using a formula in the other sheet. I have one sheet that looks similar to this -
And another that looks like this -
I would like to put a formula on the second sheet that basically says - look on the first sheet for the values in columns A and B and return me the value in column C. The tricky part is - the values in the second sheet may be inverted or there may be an instance where only one value is present, like in row 1 in the first sheet. Also the formula should only fill in a value if both columns match. All text combinations in both sheets are unique.
Is it possible to do this with text? Thank you for your help!
Try the following
=ArrayFormula((IFERROR(VLOOKUP(R2:R&S2:S,{O2:O&P2:P,Q2:Q},2,0))&
IFERROR(IF((R2:R<>"")*(S2:S<>""),VLOOKUP(R2:R&S2:S,{P2:P&O2:O,Q2:Q},2,0),""))))
(Do adjust locale and ranges according to your needs)
Functions used:
ArrayFormula
IFERROR
IF
VLOOKUP
If you can use two keys concated in the lookup table as a virtual key (i.e. make a key like "CAT|DOG"), then you can use that to look in the secondary table.
If you can't guarantee the sort order of the two keys in the secondary table, you can use the following technique to "sort" the two keys so you can make a single lookup key that's always in one stable order.
Sample Table
A
B
C
D
E
SortedKey
Cat
Dog
TRUE
Cat
Dog
CatDog
Dog
Cat
FALSE
Cat
Dog
CatDog
Formulas
Sample formulas for row #1.
For column C, use formula: =A1<B1
For column D, use formula: =IF(C1=TRUE, A1, B1)
For column E, use formula: =IF(C1=TRUE, B1, A1)
For SortedKey, use formula: =concat(D1, E1)