I want to change the cell address to string/text. For example :
AB123 --> "AB123"
I want to use it with indirect(), for example to refer to A1:A100 where the '100' is fetched from cell X1 -->
indirect( to_string( A1 ) & ":A" & X1 )
I didn't do indirect("A1:A"&X1) because since "A1" is static string so when i insert a new row on the very top so to shift down row 1, then the formula won't update automatically and will still refer to A1:A100 , in fact it should now refer to A2:A100 after the row insert. In this case i want to keep the A1 not as string so after insert it should updated to A2
What is the simplest way to do it?
Try this:
=cell("address", AB123)
This (or something like it) might also work instead of all that "indirect" stuff.
OFFSET is very good at defining changing ranges like that.
=OFFSET(A2,,,X1,1)
try:
=INDIRECT(ADDRESS(123, COLUMN(AB1)))
or:
=INDIRECT(ADDRESS(123, 28))
to get range AB123
Related
The context :
Each time i need a cell reference from my other sheet, I need others cell reference from the same line but from different column.
I would like to automate those adding reference values depending on the first reference i add manually.
I have a sheet named alpha and a sheet named beta
I have a cell A1 in alpha that refers to beta A1
I have this referred cell formula in alpha A1 to have the value from beta A1
=beta!A1
Objectif :
I would like to have in alpha B2 the cell automatically filled-in by the value from beta A7
the equivalence of this refered cell formula
=beta!A7
Because the number seven will never change, only the column can change it could be:
=beta!AC1
so I will need =beta!AC7 automatically populated.
The Goal :
The goal is to extract from the formula in alpha A1 all characters except number(s) by a formula (like SEARCH, LEN, from FORMULATEXT) to obtain
=beta!A
with this result, I will concatenate with a cell that has the value "7". to obtain the formula for the cell reference.
A
B
C
1
=beta!A1
=beta!A7
7
2
=beta!AC1
=beta!AC7
If anyone can give me this formula clue or a better way to reach my goal would be good
I tried the regex below but it removed the punctuation
=REGEXREPLACE(FORMULATEXT(A1),"[^[:alpha:]]", "")&C1 where C1 is the value "7"
But i have all the need without the exclamation mark "!"
=betaA7
instead of
=beta!A7
Thank you
this is what you want
Use this to REGEXEXTRACT all the numbers and REGEXREPLACE then with "" nothing. and add &$C1 the value in C1.
=REGEXREPLACE(A1, REGEXEXTRACT(A1, "[0-9]+"), "")&$C1
A better way
See in Beta!A1 we have a value of Im beta A1
And in Beta!A7 we have a value of Im beta A7
And in alpha!A1 we hane the formula =beta!A1
To get the value of beta!A7 using the formula in alpha!A1 as an input we use this formula in beta!B1
=INDIRECT(REGEXREPLACE(SUBSTITUTE(FORMULATEXT(A1),"=",""), REGEXEXTRACT(SUBSTITUTE(FORMULATEXT(A1),"=",""), "[0-9]+"), "")&$C1)
Explanation
INDIRECT(=beta!A1)
Even more simpler approach
Use this formula directly
=OFFSET(beta!A1,C1-1,0)
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 tried to extract some column from master table/sheet. I can use query() or filter() or vlookup() but for this example, i use this very simple formula in cell A100 :
={ calc_01!C15:C ,calc_01!F15:F }
It works fine and it will just output 2 columns in A and B column (start from row 100).
The problem is : how if i want the output into 3 column (A,B,C) where the 2nd column or column B will be empty. So i tried something like this , trying to make the 2nd column blank :
={ calc_01!C15:C ,"",calc_01!F15:F }
If i put it on cell A100, i expect the output will occupy column A,B and C (where B is blank). But it doesn't work. So does anyone know if possible to do it ?
Why i want to do this? because i have condition where on the top i have some kind of table formatting where the B column is too narrow and i'm not allowed to adjust its width, so i have to use column c instead of B.
Thanks.
Try
=index({ 'calc_01'!C15:C ,if(row('calc_01'!C15:C),,),'calc_01'!F15:F })
and see if that works?
If A1 has a value of 2, =INDIRECT("L"&(5+A1)) will return me cell L7's content. And my A1 value keeps on being updated.
But I need a way to sort through columns instead of rows, like
L7, M7, N7, O7 and so on...
Which formula can help me sort through the columns? I also know that =COLUMN() returns the current column converted to number, but I had no luck with =INDIRECT((column()+A1)&7).
You can use the address() function inside indirect. Address() returns a cell reference as a string. So for example, if you enter in G5
=indirect(address(A1, column()))
while A1 is 1 the above formula will return the contents of cell G1.
See if this helps?
How do I copy data from one cell of a column to next cell of next column if the data is greater than 2 by using formula?
Now my file is like this:
I want to transfer the data from column B to column C, whose value > than 2.
So, the sheet will be like this:
Please help me to solve this... Thank You.
You can copy the values over if they are greater than or equal to five, but moving them is not something you can do with a custom function, you would need apps script running to do that for you.
Here is what you can do: =IF(B2 > 2, B2, "") , this will copy the value over if its > 2. Just drag this formula down the sheet.
I have also added basic conditional formatting to highlight it as red.
Example Sheet
try this formula:
=ArrayFormula(
{sheet1!A2:A,
if(sheet1!B2:B<=2,sheet1!B2:B,""),
if(sheet1!B2:B>2,sheet1!B2:B,"")})
use it in separate sheet to convert existing table(1) to result table(2) from yuor example.