I want to conditionally change the text in cells:
Example: in B2 if the value is 'something' i want to change it to 'anything'
Can anybody help in this?
either:
=SUBSTITUTE(B2; "something"; "anything")
or:
=REGEXREPLACE(B2; "something"; "anything")
There are multiple ways to do it
If you want to replace value in cell B2 then
1) Use Find & Replace function (in Menu-Go to Edit>Find and replace) OR (Ctrl+H)
and fill data by choosing range like picture below
Or you can use either of this if you want replaced value in different cell
=REPLACE("something",1,4,"any")
=SUBSTITUTE("something","something","anything")
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 have for example this content in B8 : "1/2/4.5/8/9.2"
I would like to break this line at each "/" and put the value in neighbour cells. Like on this example :
I assume a ARRAYFORMULA should be use, but I can't find a way to do that... Someone has an idea ?
Best
Lets say if cell B8 has the said value, use:
=SPLIT(B8,"/")
if your locale supports semicolon convention then it would be:
=SPLIT(B8;"/")
After selecting the column, you can use Data -> Split text to columns option. Then you can use the custom separator as /.
I want to change the cell address to string/text. For example :
AB123 --> "AB123"
I want to use it with indirect(), for example to refer to A1:A100 where the '100' is fetched from cell X1 -->
indirect( to_string( A1 ) & ":A" & X1 )
I didn't do indirect("A1:A"&X1) because since "A1" is static string so when i insert a new row on the very top so to shift down row 1, then the formula won't update automatically and will still refer to A1:A100 , in fact it should now refer to A2:A100 after the row insert. In this case i want to keep the A1 not as string so after insert it should updated to A2
What is the simplest way to do it?
Try this:
=cell("address", AB123)
This (or something like it) might also work instead of all that "indirect" stuff.
OFFSET is very good at defining changing ranges like that.
=OFFSET(A2,,,X1,1)
try:
=INDIRECT(ADDRESS(123, COLUMN(AB1)))
or:
=INDIRECT(ADDRESS(123, 28))
to get range AB123
I have this situation on Google Sheets:
I want to concatenate (=A2&B2) with a merged cell, but only the first cell has a value. I want to get the values of the column "Expected results". How I can detect the first value of each work office in this example?
You can use INDEX/AGGREGATE:
=INDEX($A$1:$A$9,AGGREGATE(14,4,(ISBLANK($A$1:$A$9)=FALSE)*(ROW($A$1:$A$9)<=ROW())*ROW($A$1:$A$9),1)) & B2
Edit for google sheets:
=INDEX($A$1:$A$9,LARGE((ISBLANK($A$1:$A$9)=FALSE)*(ROW($A$1:$A$9)<=ROW())*ROW($A$1:$A$9),1)) & B2
When merging a cell, the content appears only as if it were if the first cell of that block. Hence, you need to only use that first value as your reference. For this you need to block the reference, and it would look like this:
=($A$1&B2)
You can check more information about that in this link.
Try this in D2:
=ARRAYFORMULA(IF(B2:B="",,VLOOKUP(ROW(A2:A),FILTER({ROW(A2:A),A2:A},A2:A<>""),2)&B2:B))
im trying to mark matching URLs red.
I have two sheets with URL Data.
My custom Formula looks like this:
match(A2,indirect(Sheet2!A2:A),0)
wondering why there is an error if i use =match(A2,indirect(LostURLs!A2:A),0)
so with the additional =
Anyways both methods are not working and im wondering why?
Indirect excepts the first argument to be "a cell reference as string".
So please try
=match(A2,indirect("LostURLs!A2:A"),0)
and see if that works?
Note: depending on if you want the formatting for a single cell, a column or a row you may have to use a dollar sign in the first argument of the match() function
E.g: If you'd want to repeat the formatting for column A, you would have to use
=match($A2,indirect("LostURLs!A2:A"),0)
For row 2 that would be:
=match(A$2,indirect("LostURLs!A2:A"),0)
and for a single cell
=match($A$2,indirect("LostURLs!A2:A"),0)
NOTE: Depending on your locale, you may have to change the comma's to semi-colons.
perhaps try:
=MATCH(A2; INDIRECT("LostURLs!A2:A"); 0)