Getting the row number of a hyperlinked cell in open calc - openoffice.org

I have a file with two spreadsheets, Sheet1 and Sheet2.
In Sheet1 I have cells that link to a specific cell in Sheet2. This is done, using OpenCalc's HYPERLINK function.
Let's assume I use the following function in Sheet1.A1:
=HYPERLINK("#Sheet2.D4","SomeText")
In Sheet1.A2 I would like to fetch the row number of the linked cell (Sheet2.D4), so the end result to be 4(as the 4th row from Sheet2 is linked)
How can I achieve this?
Thanks for the help!

If this is only for =HYPERLINK() formulas for such internal cell links, then it can be achieved with this formula:
=MID(FORMULA(A1),SEARCH("[0-9]+(?!.*\.)",FORMULA(A1)),SEARCH("[;,]",FORMULA(A1))-SEARCH("[0-9]+(?!.*\.)",FORMULA(A1))-1)
More universal would be a macro solution.
Greetings
Axel

Related

Google Sheets - How to write a formula that minuses the selected cells from the top cell

How would I do it so if I had a list of numbers, how could I get every number below A1 to be minuses from A1 and put next to that cell?
Paste this in B2 or see the Example Sheet
=ArrayFormula(IF(A2:A="",,A2:A-$A$1))
What about this simple formula in A2 cell?
=INDEX(A1+B2:B6)

How to reference an adjacent cell in google sheets relative to the selected cell

I am trying to use the =sum() function in google sheets, and so far, that's all I have typed into the targeted cell. For example, I want D3 to be the sum of C2 and D2. I know how to type that. =sum(C2,D2). But I want cells D3 thru D30 to have the same equation, relative to their adjacent cells. Something like this =sum(cell to the left, cell above). Let me know if you need more elaboration, or if you have the answer, great!
Solution
Paste this formula in the first cell next to your numbers or take a look at the Example Sheet
=IF(C2="",,IF(ISNUMBER(D1),C2+D1,0))
Explanation
We check the above cell ISNUMBER if so we calculate C2+D1 if not we put 0
IF(C2="",, to calculate onlt when the range C2:C is not Empty.
If you are looking for a single formula you can also try
=INDEX(IF(ISNUMBER(C2:C), SUMIF(ROW(C2:C),"<="&ROW(C2:C),C2:C),))

Google Sheets - How to concatenate values from different rows and columns if the cells meet certain criteria

I am trying to create a formula that concatenates cell values if the ticked box is TRUE Please see attached image click here to see the image
What I am trying to do is to concatenate in one string columns B and C from every row if the checkbox in column A is selected, and have them separated by a ",". You can in cell G2 an example of the final result I am trying to achieve.
You can find the google sheet in this link https://docs.google.com/spreadsheets/d/1hwm4Q89qj3ko2vJ4OASWmgz4VQr_uUaP7E7AmVdl8Ks/edit?usp=sharing
Thanks in advance.
try:
=ArrayFormula(TEXTJOIN(",",1,IF(A4:A,B4:C,)))
You can try this sheet formula first.
=IF(A4="","",IF(A4=TRUE,TEXTJOIN(",",True,B4,C4),""))
This formula has nested IF's just for additional checker to check if the first column has a value and would return blank just for it to be dynamic. You can drag the formula down to adjust the cells.
Sheet sample:

Conditional Formatting based on value of another sheet

I am using below formula that is working fine on same sheet to highlight the row where found "Terminated".
=$E3="Terminate"
I want to highlight the same row on other sheets as well where found "Terminate" on "Leave Data" sheet range E3.
Each sheet has same Employees name on Col B. May that would made it easy to highlight the same row on other sheets
Can someone please share a solution to this question.
Conditional formatting does not support direct sheet references, but you can "trick" it by using INDIRECT and CELL:
So in cell A1 of Sheet3, create a conditional formatting rule valid for the whole range A1:A100 and insert this formula:
=INDIRECT("Sheet2!"&CELL("address", E1))="Terminate"
INDIRECT
CELL
Explanation
Between INDIRECT and CELL, it creates an "indirect" reference to the value of the target cell which conditional formatting can understand.
You can also make it fill the whole row by adding a $ to the E as in this formula:
=INDIRECT("Sheet2!"&CELL("address", $E1))="Terminate"

Google Sheets: Formulas over multiple sheets

Is it possible to grab the contents of a cell from one sheet and display them on another?
I have 4 sheets. And I want the cells of the third sheet to display the first column of the second sheet on the second column.
if you want to get range from another sheet just use:
Replace 'Sheet' and 'A2:C8' with title and range you want to refer
={Sheet!A2:C8}
For multiple sheets
Replace ';' with ',' for horizontal view:
={Sheet!A2:C8;Sheet1!A2:C8;Sheet2!A2:C8}
Add the sheetname exclamation point to your cell reference
e.g. sheet!A:1
Then drag from the first cell down to as many rows as you need.
Google Sheets allows reference between sheets. the syntax is pretty simple. consider a single cell: =<sheetname>!A2 for example. From there, you can drag down with the bottom right corner, and your your column will now be a copy of an arbitrary column in , in this case A
These are the annotations for cells in google sheets
Sheetname!A:1 For Relative Cells
Sheetname!$A:1 For Absolute Columns
Sheetname!A:$1 For Absolute Rows
Sheetname!$A:$1 For Absolute Cells
Yes. For specific ranges you can use IMPORTRANGE.
Is it possible to grab the contents of a cell from one sheet and display them on another?
Yes. It's even possible to get entire columns of data.
In sheet 2 A1,
=ARRAYFORMULA('Sheet1'!A:A)
The single quotes ' can be omitted, if the sheet name doesn't have a space . In other words, if you use Monthly Budget as a sheet name, then single quotes is mandatory.

Resources