How to Return Combination of Multiple Values From Other Cells Into the Same Cell In Google Sheets - google-sheets-formula

I am trying to use Textjoin and IFS within a formula in Google Sheets to return a combination (all, none, or some) of values. I want to values to all be listed in the same cell at the end of a given row. In order for this to work, I am referencing a second tab within the same sheet.
I tried the following formula:
=ARRAYFORMULA(TEXTJOIN(" ",(IFS(Sheet2!F53="D",$F$5,Sheet2!R53="D",$R$5,Sheet2!T53="D",$T$5,""))))
What I want to happen is that if "D" is in the cell referenced on the 2nd sheet, it returns the specified text in the cell corresponding to $F$5, etc. If there are no cells with D in the referenced cell, then I just want it blank. When I used this formula, I get an error saying there is a wrong number of arguments for Textjoin.
I tried this formula:
=ARRAYFORMULA(TEXTJOIN(",", Sheet2!F23="D", $F$5, Sheet2!R23="D", $R$5, Sheet2!T23="D", $T$5, ""))
It simply listed each value in the cell corresponding to $F$5, etc and said true or false following the value. That is obviously not what I want either.

can you try:
=TEXTJOIN(" ",1,{IF(Sheet2!F53="D",$F$5,),IF(Sheet2!R53="D",$R$5,),IF(Sheet2!T53="D",$T$5,)})

Related

Data Validation from Range OR any number in Google Sheets

I'm creating data validation in Google Sheets that I would like to be able to accept either:
a selection from a range of cells or
any dollar amount from $0.01-$100.00.
I can see how to do either of these separately in separate cells using the "List from Range" or "Number" options but I don't see how to do both in the same cell.
I think I have a data validation formula that combines those two sets of criteria.
=or(and(D1>0,D1<=100),iferror(Match(D1,A2:A5,0)>0),0)
Enter the desired extra values, eg. 250, 999, in cells A2:A5. Then apply the data correction formula to a cell, such as D1.
Here is a samle sheet.
https://docs.google.com/spreadsheets/d/16cC7YKYLiG76Rn4tFSIraD1RILwsT0GQyymPat1WM-g/edit?usp=sharing
Let me know if this doesn't achieve the result you want, and I'll try again!

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

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))

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.

Data validation on the result of a formula

I'm looking for a way to default a cell value with data validation applied, but allow the user to overwrite the value to one of the valid values allowed.
I have a demo spreadsheet here.
And visually:
I have data validation on column D that provides a list of possible markup percentages from column G, however, I want a default value in there so I have written a formula to work this out (based on there being a value in an adjacent cost cell).
I enter the item, I enter a cost and the markup defaults. All good.
But, when I click the dropdown I don't get any values popup. the formula is shown instead.
I have tried conditional formatting based on making the cell text and background white, but this is sub-optimal for my real world (significantly more complex) scenario.
How can I achieve what I am after - a default value of 50% if there is a cost value, but selectable from the drop-down.
The only way to add a "default" value based on a condition is to use on edit (simple or installable) script.
Example:
The following is an simple on edit trigger. If a cell from column C below the first row is edited, then the cell to the right will be 50% (assuming that the cell format is set to display %)
function onEdit(e){
if(e.range.columnStart === 3 && e.range.rowStart > 1){
e.range.offset(0,1).setValue(0.5);
}
}
Resources
https://developers.google.com/apps-script/guides/sheets
https://developers.google.com/apps-script/guides/triggers

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.

Resources