Use specific syntax with Sheets - google-sheets

I have this:
So now, what I want is this logic but I don't write everytime in each cellul :
In B3 : =SI(A3>B1;1;0)
In C3 : =SI(A3>C1;1;0)
In D3 : =SI(A3>D1;1;0)
In B4 : =SI(A4>B1;1;0)
In C4 : =SI(A4>C1;1;0)
In D4 : =SI(A4>D1;1;0)
I just need to retrieve each cellul column A and compare to each cellul ligne 1
Someone can help me

use:
=INDEX(IF(A2:A5>B1:D1; 1; 0))

Try this:
=IF($A3>B2,1,0)
Once the absolute reference is set just drag the formula to the whole row:
Once done you just need to drag the formula down and it will be applied as you like to all the remaining cells:

Related

Google Spreadsheets, Insert a cell value to another cell

I don't know anything about scripts so I would prefer a function.
I have a table like this:
a1
b1
c1
a2
b2
c2
If "a1" = 1 a2 = today's date.
For example:
if I write to a1 cell a "1" it will "transform" into today's date,
if anything else nothing happens.
You can simply put this formula in A2 cell :
=if(A1=1,TODAY(),"")

How to use concatenate function inside arrayformula function in google sheets

I'm currently using the following formula to concatenate a few cells into a single description sort of entry in the same row, as shown here
CONCATENATE("Conducting Person : ",H2,CHAR(10),"Tech Support : ",J2,CHAR(10),"Category : ",F2,CHAR(10),"Room : ",G2,CHAR(10),"Platform : ",K2), "")
This formula is working fine but when I add a new entry in the blank row right below that last filled row, I have to manually add the formula to the required cell.
I tried the following arrayformula :
=ARRAYFORMULA(IF(NOT(ISBLANK(A2:A)),CONCATENATE("Conducting Person : ",H2,CHAR(10),"Tech Support : ",J2,CHAR(10),"Category : ",F2,CHAR(10),"Room : ",G2,CHAR(10),"Platform : ",K2), ""))
That seems to be executing the formula when an entry is made in the first cell of the blank row below the last filled row, but the cell positions are not relatively changing and seem to be fixed to the initial cell reference.
How do I fix it?
Try
=arrayformula("Conducting Person : "&H2:H&CHAR(10)&"Tech Support : "&J2:J&CHAR(10)&"Category : "&F2:F&CHAR(10)&"Room : "&G2:G&CHAR(10)&"Platform : "&K2:K)
use:
=ARRAYFORMULA(IF(ISBLANK(A2:A),,
"Conducting Person : "&H2:H&CHAR(10)&
"Tech Support : "& J2:J&CHAR(10)&
"Category : "& F2:F&CHAR(10)&
"Room : "& G2:G&CHAR(10)&
"Platform : "& K2:K)))

Google sheets conditional formatting to colour cell if the same cell in another sheet is not empty

I have 2 sheets A and B. I want sheet A to colour cells if the exact same cell in sheet B is not empty. For example if cell A1 in sheet B has a string, then cell A1 in sheet A will be coloured.
Let's say I want to do this to compare a large range, how should I go about doing this?
Example: https://docs.google.com/spreadsheets/d/1P3Ob_mclpXWmILfKwD4R6JN2wAYPUcNZlmtF9LxilV0/edit?usp=sharing
Cells A2:C2, D5 and K2 in sheet B are not empty. So the corresponding cells in sheet A will be coloured red.
You can use the following formula as a conditional formatting rule:
=NOT(ISBLANK(INDIRECT("B!"&address(row(),column()))))
(the formula in A!A2 is there to just show you what happens in sheet B)
Explanation:
Not familiar how this could be done with a custom conditional formatting formula so wait for other guys to help you out with that.
However, I can offer you a Google Apps Script solution.
The following script will check for the data range in sheet B and it will construct a color array. An element of this array will have the white hex color #ffffff" if the value in the values array is empty, or a red color #ff0000 if the value is not blank.
Then it will color sheet A based on this color array in one go. The script is relatively fast even for large ranges.
Solution / Workaround:
Don't forget to adjust "sheet A" and "sheet B" to the name of your sheets.
function colorCells(){
const ss = SpreadsheetApp.getActive();
const sheetToColor = ss.getSheetByName("sheet A");
const sheetToCheck = ss.getSheetByName("sheet B");
const bValues = sheetToCheck.getDataRange().getValues();
const aColors=bValues.map(r=>r.map(v=>v==''?"#ffffff":"#ff0000"));
sheetToColor.getRange(1,1,sheetToCheck.getLastRow(),sheetToCheck.getLastColumn()).
setBackgrounds(aColors);
}
How to use that:
Click on Tools => Scipt editor, copy, paste & save the aforementioned code and then execute it by clicking on the play button.
If you want this to work "automatically" then you can set up a time trigger to execute this function for you every n minutes.
Bonus code:
You can do the same operation but on a more user-interactive way. Again, copy, paste & save the following script to the script editor but this time don't execute it as it can work by itself.
The following script will change the color of a cell in sheet A upon user edits on the same cell in sheet B:
function onEdit(e) {
// adjust this to your needs:
const sheetToColorName = "sheet A";
const sheetToCheckName = "sheet B";
const rng = e.range;
const cell = rng.getA1Notation();
if (rng.getSheet().getName()==sheetToCheckName){
const sheetToColor = e.source.getSheetByName(sheetToColorName);
if(rng.getValue()!=''){
sheetToColor.getRange(cell).setBackground("#ff0000"); //red
}
else {
sheetToColor.getRange(cell).setBackground("#ffffff"); //white
}
}
}

Combine data from multiple cell in one cell with text

I have a row A with 200 text entries.
A1 = "A1value"
A2 = "A2value"
A3 = "A3value"
...
I want to dynamicaly display in a single cell (text format) : ga=A1value,ga=A2value,ga=A3value, [...] ga=A200value etc...
use join function:
=JOIN(",ga=", A1:A3)
for some regions semicolon is used:
=JOIN(",ga="; A1:A3)
next step: add first "ga=" manually:
="ga="&JOIN(",ga=", A1:A3)

Google spreadsheet: use value as row number

I have a return value from a function in cell A1. Let's say it's 51.
How can I use this value as a row number. I don't want 51 in A1 but instead I want the value from cell A51 in cell A1.
Is there a formula?
Use indirect:
= indirect ("A"& 51)

Resources