I have a Google Sheets spreadsheet that uses Conditional Formatting using a formula.
So, for the cell range B2:C2, I have the following formula assigned: =if(B2<100,if(C2<80, true,false),false)
This highlights B2 & C2 if B2 is less than 100 AND C2 is less than 80.
This works.
Now, I want to do this for a bunch of rows. However, if I use either copy/paste special or format painter, it does not translate the formula in the conditional formatting to indicate the new row. They all reference row 2.
Is there a way to do this, or do I have to manually add Conditional Formatting to every row?
Or, is there a better way to do this?
Change range to B2:C and forumula to:
=($B2<100)*($C2<80)
Related
I need to add a 0 before all cells in the A column on Google Sheets. Is there a code or formatting function I can add in? I need them to look like A2. A3 is what I have right now. There are a total of 783 that were extracted like this and I don't wanna do this manually
I tried formatting a few ways but I'm still a beginner in Sheets & Excel
You can try with ARRAYFORMULA in another column:
=ARRAYFORMULA(0&A1:A)
=INDEX(0&A1:A)
(PS: you may change A1:A with A1:A783)
If you want to just change the values in that column, you may use FIND AND REPLACE --> (Edit -> Find and Replace), be sure you tick "Search using regular expressions". Put to find ^ and to replace 0
NOTE: thanks to #rockinfreakshow, prior this second option, first format to plain text:
And then do the replacement:
You can use this formula in the adjacent cell:
Then you apply it across all your rows.
Do not forget to copy and paste as values.
I'm trying to do something that would be simple in Excel, but in Google Sheets you have to use INDIRECT in a formula to get a value from a different sheet.
All I want to do is pull the value in Sheet1!B2 if Sheet1!A2 equals A2.
I tried it several ways, below are a couple
=IF(Sheet1!A2=A2),INDIRECT("Sheet1!B2")
and
=INDIRECT("Sheet1!B2")IF(Sheet1!A2=A2)
in Google Sheets you have to use INDIRECT in a formula to get a value from a different sheet
is not correct.
Try:
=if(A2=Sheet1!A2,Sheet1!B2,"")
If that does not return the content of Sheet1!B2 then A2 does not equal Sheet1!A2 (even if they look the same).
I have a sheet containing my weekly schedule. Only school cells have a room number in it, so how do I format the cells to color only the ones that contain a number.
note: Actually, the room number is a number in range(A:E) followed by a three digits number in range(000:499). Ex.:(A433, B166, D254)
I tried: Text contains"(A:F)(000:444)" but it didn't work.
EDIT:
For some reason, "=REGEXMATCH(B2, "[A-F][0-9]{3}")" worked. Could anyone tell me why? I tried replacing B2 by B1, but then it didn't work. Does it have anything to do with the fact that B1 is a weekday, and so does not contain REGEXP(B1,"[A-F][0-9]{3}) returned false.
What seemed more logical to me was "=REGEXMATCH(B2:F22, "[A-F][0-9]{3}")" To apply this function in range B2 to F22. What am I missing here?
In order to match patterns, you'll need to use regular expressions. Since the standard Conditional Formatting options don't include regular expressions, you'll need to choose "Custom formula is" and then use REGEXMATCH, which returns a Boolean value.
If you really want to look for the specific room number format you mentioned, then you would use the formula:
=REGEXMATCH(A1, "[A-E][0-9]{3}")
But if you just want to look for any numbers, you can use
=REGEXMATCH(A1, "[0-9]+")
In both cases, the text you're checking is in cell A1
You might try Conditional Formatting with a custom formula rule of the type:
=if(isnumber(A1),1,regexmatch(A1,"\d"))
The above was an attempt to respond to:
Google spreadsheets conditional formatting if text contains numbers
A more particular fit for the stated room number style would be:
=REGEXMATCH(A1,"[A-F]\d\d\d")
where the first character is any of the first six letters of the alphabet, if capitalised, followed by three instances of any number.
I've got a google sheet with duplicate cell values. I was wondering if there's a quick and easy way to replace all those duplicates with a reference to just one of them, i.e "=[cell]".
yes, this is possible to do with formula.
Paste this in B2 and copy the formula down:
=if(countif($A$2:A2,A2)>1,"["&ADDRESS(MATCH(A2,A:A,0),COLUMN(A2),4)&"]",A2)
Then to get actual cell refference, use script:
this formula makes text looking like reference: =if(countif($A$2:A2,A2)>1,"="&ADDRESS(MATCH(A2,A:A,0),COLUMN(A2),4),A2)
script must getValues and then setFormulas to range B2:B
What I did is pseudocode basically and I just want to specify the sheet using a cell as shown in the picture. What is the proper notation (if there is any)?
(Trying to solve E3 in this example. It should show a number from another sheet, and I just want to make it easy to copy/paste down column E by referencing to the sheets using the strings in column A)
You can use INDIRECT() function to do that, for example :
=INDIRECT(A3 & "!B4")
You may need to wrap sheet name with quotes if it contains special character(s) :
=INDIRECT("'" & A3 & "'!B4")