Google Sheets: How do send code to a blank cell? - google-sheets

If I have code written in cell A1 and cell B2 is blank, is there any function which will overwrite B2 with the contents of A1, but leave B2 blank if the function isn't enacted?
Or is there any other way to do this with Google Sheets?

you can try this in B2 cell:
=A1

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)

GoogleSheets Conditional Format based on formula in the current Cell

I have tried the following as the Conditional Formatting Custom Formula:
Where B2 is the current cell:
COUNT(FIND("$B$1",FormulaText(B2)))>=1
the formula in B2 is A2*$B$1 in B3 is A3*$B$1 etc. - but some cells do not reference B1
If I paste this into a cell/range in column C:
=COUNT(FIND("$B$1",FormulaText(B2)))>=1
then it correctly returns true or false depending on the formula in the adjoining cell.
However when applied as a conditional format it is not changing the format of cell B2
I also want this formula to apply to a range of cells - but it seems to apply the identical formula COUNT(FIND("$B$1",FormulaText(B2)))>=1 to each cell and not change B2 to B3, B4, B5 etc.
Thank you you to #kirkg - this is resolved simply by applying the format to a range in both columns A&B:
Here is his sample sheet... docs.google.com/spreadsheets/d/… – kirkg13

Include link created with CONCATENATE from one cell into IMPORTHTML formula in another cell

I am generating a link combining two values from two cells C2 and D2 using CONCATENATE formula in cell B2. Then I want to include generated link into another formula =IMPORTHTML("URL"; "table"; 3 ) in A2 cell. A simple pointing of a cell B2 in field "URL" in the abovementioned formula did not give a good result. Please help fix syntax.
Instead of
"B2"
Use
B2
The formula will be
=IMPORTHTML(B2;"table";3)

Conditional formatting in Google Docs

Struggling like hell with this one but bet it's so simple!
Can do it in Libre but not in Google :-(
What I want to do is:
I have a range of cells with numbers in, ranges B8 to F20 and another set of cells in range B2 to F2
If a number in cell range B8 to F20 is same as one in range B2 to F2 I want to highlight the cell in range B8 to F20
Any help appreciated, I'm pulling my hair out :-)
Try custom formula:
Set custom formula in cell B2
=countif($B8:$F20,B2)
Apply to range B2:F2
Try selecting cells B8:F20 and click Format > Conditional formatting > Custom formula is:
=arrayformula(sum(n(value(B8)=arrayformula(value({$B$2:$F$2})))))

Fill column with maximum/last value from another column

How can I get the result as in example with ARRAYFORMULA up to last filled cell A?
I can do it with formula in cell C1 =MAX(B$1:B1) but in that case have to copy the formula in each cell in turn.
In C2 try:
=ArrayFormula(if(row(A2:A) <= max(if(not(isblank(A2:A)), row(A2:A))),vlookup(row(A2:A),filter({row(A2:A),B2:B},len(B2:B)),2),))
See this spreadsheet for an example.

Resources