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 /.
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 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 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")
try this.
in cell A1 10/8/2013 Mike1, 2013, 0
now Split(A1,",")
now change A1 and add a colon 10/8/2013 Mike:1, 2013, 0
Split(A1,",") ... notice how Mike:1 is gone. Bug?
I need to split something with a colon in it and it is chopping off part of the text
The problem is that "10/8/2013 Mike:1" is interpreted as a date, it seems to be something like: "dd/mm/yyyy hhhh:mm". (if you change the display of the first cell to raw text you'll see he is giving you a number: 41496).
try this formula:
=arrayformula(SUBSTITUTE(arrayformula(split(REGEXREPLACE(A1;":";"###");","));"###";":"))
in a easier way: As I suppose you can't change the way it's displayed, the possible workaround that I see here is to first split around the ":", then split with the "," and then join the two first elements.
I can't reproduce this issue, either with function SPLIT or with Split text into columns... and with or without formatting as dd/mm/yyyy hhhh:mm.
Select A1, Data > Split text into columns... is all that is required.
I am trying to do a calculation of two cells, where one of them contains a number like this: 1 250.
If the number is written like that, and not 1250, then I cannot get the spreadsheet to do any calculations with it. Google suddenly do not treat it as a legit number anymore.
Why not just type 1250 instead of 1 250?
Well, I am getting the cell values from a html import function.
Any good advice on how to get around this?
Try something like this:
=Substitute(A2," ","")
In this formula, A2 is a cell. You are finding any spaces in that cell and then replacing it with a "non-space".
Use the substitute function to transform your number before using it in a formula. For instance, let's say you wanted to multiple F8 by 2, but F8 may contain spaces. You would then do:
=substitute(F8, " ","") * 2
Substitute didn't work form me. But these steps did:
Select one or several columns of data
Press Ctrl + H to get the "Find and Replace" dialog
Make sure "Search using regular expressions" is checked ✅
Enter \s to the "Find" field, and leave "Replace with" empty
Click on the "Replace all" button
Explanation:
\s is a regular expression matching any kind of whitespace character. There may have been some other kind of whitespace in my spreadsheet, not a regular " " (space) character, and that's why regex worked for me, while SUBSTITUTE() didn't.
I've also tried the REGEXREPLACE(A2, "\s", "") function, but it didn't seem to to anything in my case.