Fetch offset cell from regexextract on different sheet tab if data validation equals certain value - validation

I have searched around but can't find anything that gets me quite there. I have tried various methods but can't get it.
Sheet A - has Tab 1 and Tab 2
In Tab 1, cell O22, I have a data validation list of items. Depending on the item I pick, I want the cell below - O23 - to check a column on Tab 2 and find the phrase from cell O22.
When the phrase is matched then get an offset cell one to the left of the matched value on Tab 2 and return that result into cell O23.
This is because I am using the data validation to allow for a choice of items and ultimately return a URL which is then fed into a Google Sheets app script. I've tried using indirect, offset, address etc but I keep falling short.
Any tips would be appreciated.
EDIT: An example copy is here: removed - thank you.

use VLOOKUP
=IFNA(VLOOKUP(O22, {Sheet2!E27:E29, Sheet2!A27:D29}, 2, 0))

Related

Is there a way to hide the formula in a Google sheet cell?

I want to block certain users/groups from viewing formulas in certain cells in Google sheet, but they'll have permission to edit other cells values. All they will be able to see is the result.
explanation: it's an advanced calculator. let's say that I want to give the user the ability to put values in cells A1 and B1, and in C1 the formula is =A1+B1.
I want to hide the formula in C1, so the user will only the the result.
There's a few ways to do it depending on how/who is working on the sheet. If people aren't familiar with sheets you can actually hide the formula in a row at the top by using array formulas so in the header:
={" header title" ; arrayformula(a2:a+b2:b)}
The formula would be hidden in the cell that shows the header, all the cells below would just be the calculation. If you hide the row that has the arrayformula and protect it no one will be able to see it. The only thing is you have to also protect the column otherwise if someone hardcodes a value in the column the formula will stop working.
The second option (easier but can run into more issues is the have a 'mirror' copy of the sheet they are interacting with in the same file as a hidden sheet. Basically a duplicate of the tab with all the cells a direct reference of the first tab. So:
Sheet1 = tab they interact with
Sheet2 = 'mirror' tab with every cell being ='Sheet1'!a1, but for the corresponding cell value.
As they edit Sheet the values entered in Sheet1 will show up in Sheet2, then the calculations can happen on that sheet, and then Sheet1, can just be a direct reference to that column in Sheet2. So the calculations in Sheet1 will only appear ='Sheet2'!C2. If you protect Sheet2 and hide it no one will be able to see the formulas. Sheet1 could even reference Sheet2 with an index formula like: index(column sheet2,,) which would return the entire column from sheet2.

Google Sheets - Dynamic Cell Range For Data Validation, Specifically List Of Items Criteria

I am having some issues with specifying a dynamic cell range for a "data validation".
I'm aware you can do some tricky stuff with = "Projections!M4:M"&O2. You can update the content of cell O2 for example to 3 and the output would be Projections!M4:M3.
This makes the value "dynamic". These tricks don't seem to work in the "Cell Range:" input field in the Data Validation selection/configuration screen.
My problem is, I hate seeing drop down arrows (call me o.c.d) for rows that have no content, my number of rows will grow in the future so I don't have any other option than selecting M4:Mfills the whole 1002 rows with drop down arrows.
Has anyone worked out a trick to make dropdown arrows only show up for rows that are filled?
I'm using = COUNTA(B4:B)to get the number of rows that are filled and = "Projections!M4:M"&O2 to make the desired Projections!M4:MX string but the "Cell Range" input field in the Data validation screen doesn't accept this as valid either.
Well I didn't find a direct solution, but something that I can work with to resolve my issue which was I hate seeing drop down arrows for empty rows.
I turned a filter on for a column that will always be filled in and filtered by conditions Cell is not empty but i'd prefer a better solution.

Filter() formula ignoring blank cells

I'm trying to use the filter() formula within a spreadsheet, from another tab within that spreadsheet.
I've got a number of drop-down menus that, when used, bring up the relevant data from the table I'm filtering from.
I've managed to make it work when it's a table of data from row 2 downwards (row 1 being a header row), but now the table starts from the 6th row down with other information above it (most of it, however, is blank). As such, now all of the options come up automatically when the drop down menus are blank.
I either need the formula below to start from the 6th row down, or to ignore the blank cells. It must be an easy solution but for the life of me, I can't find it anywhere on the internet (I'm pretty new with spreadsheet formulas so please be gentle).
This is the formula I've been using that works when there are no blank rows:
=FILTER(Sheet2!A:T,(Sheet2!D:D=B12)+(Sheet2!F:F=C12)+(Sheet2!G:G=D12)+(Sheet2!H:H=E12)+(Sheet2!I:I=F12)+(Sheet2!N:N=G12)+(Sheet2!O:O=H12)+(Sheet2!T:T=I12))
If it helps, the drop-down options are both numbers and text, and I'm using Google Sheets rather than Excel.
You can probably just change your ranges to 'A6:T' instead of 'A:T'. 'A:A' range syntax gets all rows in that column. 'A6:A' will start it at 6 but not define an ending row, which I think is what you want.
This is your formula with those small changes:
=FILTER(Sheet2!A6:T,(Sheet2!D6:D=B12)+(Sheet2!F6:F=C12)+(Sheet2!G6:G=D12)+(Sheet2!H6:H=E12)+(Sheet2!I6:I=F12)+(Sheet2!N6:N=G12)+(Sheet2!O6:O=H12)+(Sheet2!T6:T=I12))
The =isBlank() formula may be useful to you as well. It takes a cell reference and returns true/false. You can wrap this in NOT() to give the opposite result, i.e =NOT(ISBLANK(A1)) will return true if there is a value.

In Google Sheets, Is there a way to use hyperlinks in a data validated range?

In Google Sheets, a cell using a data validated range consisting of hyperlinks will only display the link text and is not an actual link.
Example, I have a google spreadsheet consisting of 2 sheets. Sheet 1 has a cell with data validation getting it's values from a range on sheet 2, like so Sheet2!B2:B50
Sheet 2 cell B2 contains a hyperlink like this:
=hyperlink("https://docs.google.com", "LINK TEXT")
When you select that item back in Sheet 1 in the validated cell, the cell only displays LINK TEXT and is not a hyperlink.
Is there a way to use hyperlinks in a data validated range?
I think, there's still no direct way to do this since you'd asked the question. But it's possible in two ways:
make OnEdit script and replace selected text with
corresponding link
make 2 separate columns and emulate choise.
I want to suggest the second way as it's easier to implement.
The result will look like this:
Here's the link to my test file.
Step 1. Prepare data
So Sheet2 contains data, it should look like this:
Separate:
links in column B
and their labels in column A.
Step 2. Make Data Validation
Go to Sheet1. And in required range make the new rule for Data Validation. In our sample it's column A. So select range > Go to Data > Validation... > select range Sheet2!A2:A100 from your data sheet.
Note that in Google Sheets you may use bigger range for validation, sheets would ignore blanks.
Also there's a good reason to make the result of selection invisible. To make it, select custom number format and use this text:
;;;
Step 2. Make Hyperlinks with formula
In Sheet1, cell B2 paste the formula:
=ArrayFormula(if(A2:A<>"",HYPERLINK(VLOOKUP(A2:A,Sheet2!A:B,2,0),A2:A),""))
It will expand automatically.
That's all!

Google Spreadsheets: Working with data inserted from forms across tabs

I'm in great need of help. I've a form which asks basic questions and puts the results into rows of an existing spreadsheet.
Specific data from those responses are "promoted" to 2nd, 3rd and 4th tabs based on IF formulas on tabs 2+ checking the value of a pull down selection on in the corresponding row on each previous tab. (Waterfall)
My challenge is - forms data is inserted into a new row (Does not use existing) and if I set the pulldown value to "Approved" on the first tab, the formulas on the second tab which were contiguous now skip the row where the form data was automatically entered.
I suspect I need to learn how to properly use ArrayFormula, etc, but have not managed to fix this looking at existing examples combined with my IF statements.
Help is appreciated. Sample is here. Safe to ignore the first and last tabs.
Thank you.
You can try using an open-ended range with ArrayFormula. For example, the formula on "2-Pipeline" in cell D3 could be:
=arrayformula(IF('1-IdeasReceived'!U2:U="Approved",'1-IdeasReceived'!L2:L, ))
The ranges U2:U and L2:L should pick up all rows in those columns, even after you've had forms submitted.
Since this is an ArrayFormula over column ranges, you only need it in cell D3; it will inject CONTINUE formulas down the rest of the column.
Warning: Your spreadsheet is combining dynamic row content (e.g. pulled from another sheet) with static content (e.g. "Environment, Health & Safety" column on "2-Pipeline" sheet). This is bound to result in misalignment if rows are added or deleted in the middle of the source data.

Resources